• Resolved footy4kids

    (@footy4kids)


    Hi

    Love this plugin!

    Is it possible to centre the TOC on the page?

    And can I set the initial view to collapsed rather than expanded? Like the image below. Thanks!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter footy4kids

    (@footy4kids)

    I’ve found the setting that allows the TOC to be ‘folded’ initially.

    Not worked out how to centre the TOC on the page yet though!

    • This reply was modified 8 months ago by footy4kids.
    Plugin Author WPJoli

    (@wpjoli)

    Hi, thank you !

    If you want to center the TOC, you can use the built in filters to “wrap” the TOC inside a custom div that will allow you to keep it centered.

    In your theme’s functions.php, try adding this code:

    add_action( 'joli_toc_before_table_of_contents', 'before_toc' );
    
    function before_toc(){
        echo '<div style="display:flex;justify-content:center;">';
    }
    
    add_action( 'joli_toc_after_table_of_contents', 'after_toc' );
    
    function after_toc(){
        echo '</div>';
    }
    Thread Starter footy4kids

    (@footy4kids)

    That works ??

    Thanks.

    Plugin Author WPJoli

    (@wpjoli)

    Great !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to centre the TOC on page and initial view’ is closed to new replies.