WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Simple Facebook Connect] Disable plugin on certain pages

[Plugin: Simple Facebook Connect] Disable plugin on certain pages

  • titous09
    Member

    @titous09

    hi there. i have to say that i love the plugin, especially the new update. however, i’d like to be able to disable it on certain pages. for example, i’d like it enabled on all my blog posts, but on none of my website pages, for example this one: http://www.photocs.net/client-list/client-vince-miranda/

    what file and how do i edit it to solve this? thank you!

    it may also be a good feature to have on the next release!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Samuel Wood (Otto)
    Keymaster

    @otto42

    Just use CSS to hide it on the pages you want to hide it on.

    Step one: Edit your theme’s header.php file to use the body_class() function properly. Like so:

    <body <?php body_class(); ?>>

    Step two: Use CSS in your theme’s style.css file to hide the like button on the pages you want it hidden on.

    .page-id-1462 .fb_iframe_widget {
      display:none;
    }

    Change the page ID as needed.

    Using proper functions like body_class() and post_class() and such in your theme means that you don’t have to make code changes just to change the looks of things on individual pages and posts and such. Nor do you really need a big ugly options listing.

    titous09
    Member

    @titous09

    I’m with you on Step 2, but I’m not sure about Step 1; where exactly in my header.php do I put that line of code?

    Samuel Wood (Otto)
    Keymaster

    @otto42

    Where you have <body> in your header.php (possibly, might be elsewhere in the theme), replace it with <body <?php body_class(); ?>>.

    The body_class function is built into WordPress and makes it add all sorts of useful classes that are handy for themeing.

    titous09
    Member

    @titous09

    i’ve found the following line in my header.php

    <body<?php if (is_home()) { if (get_option('deepfocus_featured') == 'on') echo(' id="home-featured"'); else echo(' id="home"'); } ?><?php if ( get_option('deepfocus_cufon') == 'false' ) echo(' class="cufon-disabled"'); ?>>

    is that the line i should be editing; and if so, how?

    thanks for your continued help!

    [Please post code snippets between backticks or use the code button.]

    wkeving
    Member

    @wkeving

    I’ve got the body_class() function in my theme’s header file as you’ve shown here. I’ve included a line of CSS code, using my page id instead, similar to the one you provide here as well. Any ideas as to why it might still be displaying?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Simple Facebook Connect] Disable plugin on certain pages’ is closed to new replies.