WordPress.org

Forums

[Plugin: Simple Facebook Connect] Disable plugin on certain pages (6 posts)

  1. titous09
    Member
    Posted 3 years ago #

    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!

  2. 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.

  3. titous09
    Member
    Posted 3 years ago #

    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?

  4. 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.

  5. titous09
    Member
    Posted 3 years ago #

    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.]

  6. wkeving
    Member
    Posted 3 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic