WordPress.org

Support

Support » Plugins and Hacks » [Resolved] disabling filters for individual pages / posts

[Resolved] disabling filters for individual pages / posts

  • Hello,

    Love the plugin, working great – except that it is showing the ‘like’ buttons on all of my static pages as well as content posts.

    I’m about to dive into the code for the plugin to try and figure out which filters I need to disable for the page displays (I have a bunch of pages that include each other to display a main page and end up with 15 like buttons all over the place ;P ), but it would be nice to be able to disable the like buttons etc on pages and/or posts (or even individual pages / posts ideally)…

    Thanx again!

Viewing 1 replies (of 1 total)
  • Plugin Author Samuel Wood (Otto)
    WordPress.org Tech Dude

    @otto42

    Put something like this into your theme’s functions.php file.

    remove_filter('the_content', 'sfc_like_button_automatic', 30);
    add_filter('the_content', 'sfc_like_button_semi_automatic', 30);
    
    function sfc_like_button_semi_automatic($content) {
     global $post;
     // use any rules you like here.. this one disables it on pages
     if ($post->post_type != 'page') {
      $content = sfc_like_button_automatic($content);
     }
     return $content;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] disabling filters for individual pages / posts’ is closed to new replies.