Hello,
I apologize for the inconvenience you are facing with the Rank Math TOC Block not being tailored to each post in the Twenty Twenty Four theme.
To resolve this issue and have a unique Table of Contents design for each post, you can follow these steps:
-
Edit Theme Files:
- Open your theme’s
functions.php file.
- Add the provided PHP code snippet to convert the Rank Math TOC Block into an accordion.
- Save the changes to the
functions.php file.
-
Custom CSS:
- Open your theme’s
style.css file.
- Add the provided CSS code snippet to style the TOC Block.
- Save the changes to the
style.css file.
By following these steps, you can add a toggle button to the Rank Math Table of Contents block, allowing it to expand and collapse when clicking on headings, ensuring a unique design for each post.
If you encounter any difficulties or need further assistance, please feel free to ask.
Thank you for bringing this concern to our attention.
Best regards.
Sources:
How to Add Rank Math’s Table of Contents Block Ā» Rank Math
Where do I find the “provided PHP code snippet” and “CSS code snippet to style the TOC Block”?
Hello,
Thank you for contacting Rank Math support.
Can you please share a screenshot and or link to the YouTube comment you’re referring to? That’d give us context for the issue you’re experiencing.
Where do I find the āprovided PHP code snippetā and āCSS code snippet to style the TOC Blockā?
You don’t have to worry about this for now. You can follow the bot’s guide only if you want to style your TOC website-wide, in which case you’d use custom CSS targeting the TOC class:
.wp-block-rank-math-toc-block
Thank you for your patience and cooperation. We are looking forward to hearing back from you.
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.