Can I customise table of contents.

#594073
  • Resolved Anonymous
    Rank Math free

    Can I collapse the table of contents in the menu icon? And can I also customize the table of contents. I mean can I edit the table of contents to look good?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    I’m sorry to inform you that, by default, there is no option available to make Rank Math ToC collapsable but if you want you can use the following customize CSS on your site to achieve this:

    .wp-block-rank-math-toc-block {
    	position:relative;
    }
    
    .wp-block-rank-math-toc-block h2 {
        background: #f1f2f6;
        padding: 10px 12px 10px 18px;
        cursor: pointer;
        font-size: 18px !important;
        font-weight: normal !important;
        position:relative;
        margin-bottom: 0;
    }
    .wp-block-rank-math-toc-block h2:before {
    	display:inline-block;
    	content: "";
            width: 0;
    	height: 0;
    	border-style: solid;
    	border-width: 6px 0 6px 12px;
    	border-color: transparent transparent transparent #000000;
    	margin-right: 8px;
    }
    
    .wp-block-rank-math-toc-block nav{
    	padding: 10px 10px 0px 10px;
    	max-height: 0;
    	overflow:hidden;
    }
    .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 on 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/i82VnJ3Z

    Here’s how you can add filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Regarding the customization, you can use the default settings to change the color, background color, etc.
    https://rankmath.com/kb/table-of-contents-block/#num-3-3-color

    But if you want further customization then you’ll have to use custom CSS on your site.

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    Anonymous
    Rank Math free

    Hey,

    Filter hook not working. I tried in every way.

    Hello,

    It seems to be working fine on our end. If it is not working on your end, 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.
    Sensitive Data Section

    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.

    Anonymous
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Let me tell you this code works while logged in. Other than that no. That’s why check once in incognito mode as well

    Thank you.

    Hello,

    Thanks for sharing the logins.

    jQuery wasn’t loading on your site for non-logged-in users and which is why the error: Uncaught ReferenceError: jQuery is not defined was causing the issue.

    I’ve added an additional line to the code so that it tries loading jQuery from Google’s CDN.

    The issue is fixed, as you can see in the screencast added to the sensitive data section.

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    Anonymous
    Rank Math free

    Thanks it’s working.

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Can I customise table of contents.’ is closed to new replies.