Support » Plugins and Hacks » [Plugin: Simple Facebook Connect] exclude pages?

[Plugin: Simple Facebook Connect] exclude pages?

  • Hi Otto,

    Is it possible to automatically add a like button bu exclude certain pages (i.e. the contact us page)?

    I tried hacking your plugin using is_page() but I cannot seem to get it to parse correctly. Is there a filter and/or function somewhere that needs to be enclosed in an if statement?

    Any suggestions would be greatly appreciated

    Thanks in advance.


Viewing 7 replies - 1 through 7 (of 7 total)
  • To answer my own question, I guess one possible solution is to use the manual setting and place the function that calls the buttons inside the post/page templates. This requires the use of multiple templates, which is ok, I guess.

    Another solution would be to use a plugin like widget logic and place the buttons in widget areas, however, in my case I would have to create a new widget are.

    I suppose the hack I was trying to use didn’t work because the filter acts on content, which is inside the loop, so it isn’t possible to use a conditional is_page statement to limit this, however I am still wondering if there is some way to exclude certain pages in the code itself, without having to create new widget areas or potentially, new page templates.

    If the above is indeed possible, I have a feature suggestion:

    add a dropdown to the GUI that excludes certain pages or page types (templates). Also potentially post types.

    This may be a real pain, but I’m just spitballing here. I am curious to know what your thoughts are here.

    Love th plugin by the way.



    Plugin Author Samuel Wood (Otto)


    WordPress.org Tech Dude

    At the top of your page template where you want to exclude the like button, put this line of code:

    remove_filter('the_content', 'sfc_like_button_automatic', 30);

    Alternatively, put that in your theme’s header.php or functions.php inside of an is_page based conditional.

    Thanks Otto

    I guess if it is set to manual I could also wrap the call to the function in an !is_page based conditional- am I right?

    Hi Otto

    I need to contact you about some advice you gave a while ago concerning putting a conditional statement around the comments_template so the the comments box will only appear on the last page of a multi-page post. Is there a facility to send you a private message in wordpress?




    Forum Moderator

    @safesoundaudio: It is impolite to interrupt another poster’s thread with a question of your own. Also these forums do not have any PM system. Any support given here happens here.

    I’m so sorry to interrupt your thread. My apologies.

    Plugin Author Samuel Wood (Otto)


    WordPress.org Tech Dude

    @swiftini: If it’s set to manual, then it won’t automatically include the like button at all. You’d have to use something in the theme to make the like button display in that case.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Simple Facebook Connect] exclude pages?’ is closed to new replies.