Hello,
Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.
Please add this bit of code in your theme functions.php file : https://pastebin.com/jLTDeAWw
Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes.
Looking forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hi Sandeepan, thanks for your answer.
I added it to the bottom of the functions.php but it didn’t work. Now I made a separate rank-math.php file as instructed via the rankmath page you linked to, but it doesn’t work either. In the sensitive data you can find a picture of the implementation.
Do you know what might be wrong?
Also the code you sent me says “Convert Rank Math FAQ Block Into Accordion” but it’s for the Table of Contents, right?
And just out of curiosity, what does the “wp_footer” do in the “add_action”?
Thanks in advance and best regards,
Max
Hello,
Please try to replace the filter with this one and see if that works for you: https://pastebin.com/i82VnJ3Z
However, the reason for adding the function to the wp_footer
action hook is that the wp_footer
action hook is triggered at the end of the HTML document, just before the closing tag. This means that all the content of the web page, including the content generated by plugins and themes, has already been rendered by the time the turn_rm_toc_collapsable()
function is executed. This is important because JavaScript code is usually executed after the HTML document has been rendered, so it ensures that the JavaScript code is executed at the correct time after all the HTML has been rendered.
Let us know how it goes. Looking forward to helping you.
Thank you.
That did the trick, thanks a lot! The “.wp-block-rank-math-toc-block” is also what I use in the Custom CSS fields.
Hello,
Glad that helped.
Please feel free to reach out to us again in case you need any other assistance.
We are here to help.
Thank you.