Disable the TOC for posts that belong to the “buying-guides” category
-
Current Approach: I have attempted to use the following code in my theme’s
functions.php
file:<code> function disable_easy_toc_in_category($display) {
if (is_single() && has_category('buying-guides')) {
return false;
}
return $display;
}
add_filter('ez_toc_show', 'disable_easy_toc_in_category'); </code>Despite implementing this code, the TOC continues to display on posts within the specified category. I have also tried other methods without success.
Could you please provide guidance or suggest a solution for ensuring the TOC does not appear on posts in the “buying-guides” category? If there are specific hooks or filters provided by the plugin that I should be using, or if there is another approach you recommend, I would greatly appreciate your advice.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.