How to exclude Headings by CSS class (Solution)
-
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.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘How to exclude Headings by CSS class (Solution)’ is closed to new replies.