• Resolved cXD4931

    (@xbor17)


    If you want to exclude headings using a CSS class, use this php snippet on your functions.php or insert it through plugins like WP Code and Custom Snippets:

    /**
    * Exclude headings with a specific CSS class from TOC
    */
    add_filter( 'ez_toc_exclude_by_selector', function( $selectors ) {
    $selectors[] = '.your-custom-css-class-goes-here';
    return $selectors;
    });

    This is useful if you want to hide specific headers for example created by page builders like Elementor or Divi.

    • This topic was modified 8 months, 3 weeks ago by cXD4931.
    • This topic was modified 8 months, 3 weeks ago by cXD4931.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter cXD4931

    (@xbor17)

    I hope it helps someone here!

    Plugin Support Akshay A

    (@akshaycode1)

    @xbor17 Thank you so much for sharing this valuable insight with the community. Your effort and willingness to help others is truly appreciated!

    It is exactly what I need but it doesn’t seem to work on my website.

    Once you added this code to the functions.php file, you add the short code [ez-toc ez_toc_exclude_by_selector] on your page ?

    TOC put everything that is in my header in the table of content as title.

    Thank you for your help.

    Emma

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

The topic ‘How to exclude Headings by CSS class (Solution)’ is closed to new replies.