-
I have encountered the same problem like this guy’s question, and tried the instruction as the last instruction Rakibuzzaman Siam suggested, but it still not work? Can you tell me how to make the Collapsible Section in Rank Math ToC Block look like this one attachment 1
or make it like the styles shown in image 2
and image 3
, default to hide the table of contents and show when clicking the “show” text button.
Thank you!
-
And this is the guy’s problem ticket link you have solved, please take a look at it.
This is the example table of contnets style i want, can you tell me how to make it using rankmath?
TOC from this article
Hello,
Although the solution we shared from the other ticket will not make the very same style and behavior you want, it should give you the same functionality.
Can you please confirm if you have successfully added both the Javascript and CSS code as instructed on this reply?
If you are still having trouble applying the code, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hi i have shared it, please take a look at it, how I can add the hide and button TOC style like it in this article
Now the TOC for my draft post are not Collapsed when I open it on the preview mode, when I click the table of contents text, it did collapse, but i need to let the others know it can collapse or unfold when click it, just like the example article i send or like the arrow style from the other ticket.
Please let me know what I can do to make it. When I publish the first post, the table of contents cannot collapse, please also take a look at it.
Hello,
We’ve tried to check your website but the temporary login you’ve shared is redirecting to your homepage.
However, you can try to add the following Custom CSS on your website and see if that works for you:
.wp-block-rank-math-toc-block { position: relative; } .wp-block-rank-math-toc-block h2 button.toggle-button { background: #ddd !important; color: #000 !important; padding: 10px 12px; cursor: pointer; font-size: 18px !important; font-weight: normal !important; position: relative; margin-bottom: 0; border: none; display: flex; justify-content: space-between; } .wp-block-rank-math-toc-block h2 button.toggle-button:focus{ outline: none !important; } .wp-block-rank-math-toc-block nav { padding: 10px 10px 0px 10px; max-height: 0; overflow: hidden; transition: all linear .3s; } .wp-block-rank-math-toc-block input:checked + h2 ~ nav { max-height: 100vh; overflow: visible; }
Here’s a guide you can follow to add this custom CSS to your site:
https://www.wpbeginner.com/plugins/how-to-easily-add-custom-css-to-your-wordpress-site/Once done, please add this filter to your site: https://pastebin.com/KW6PYPzc
Here’s how you can add filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Let us know how it goes. Looking forward to helping you.
Thank you.
Hello,
Unfortunately, the image links you’ve shared are not working. However, we’ve checked your page and we can see that the jQuery is not loading on your site, and possibly that’s why the issue is occurring.
In this case, you can try to add the Google jQuery CDN before the script tag and see if that works for you.
Here you can check the full code with Google jQuery CDN: https://pastebin.com/LqxCndcB
Let us know how it goes. Looking forward to helping you.
Thank you.
Hi it seems works and the collapsible works properly, however, i use the Astra Child Theme, when i add the full code with Google jQuery CDN, the primary menu in header and footer menu is not showing. When i remove the code, it works, do you know how to adjust the codes?
Hello,
We might need to take a closer look at the settings. Please extend the temporary login access in the sensitive data section so that we can check this issue further for you.
Looking forward to helping you.
Thank you.
I have sent it, please check it
Hello,
We’ve modified the code and added it to your theme’s functions.php file and now the Table of Contents is working properly also your primary menu is showing in the header and footer without any issue.
Please check the screencast in the sensitive data section for your reference.
However, there was no ToC added to your post and that’s why we had to add this for troubleshooting. We kept the ToC on your post so that you can check it from your end.
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.Hi The table of contents looks good on desktop, but it not show correctly on mobile and tablet, can you help me check it why? Is it because of the code? You can log in using the link I sent in sensitive data.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.
The ticket ‘Collapsible Section in Rank Math ToC Block’ is closed to new replies.