Forums

[Plugin: Visitor Like/Dislike Post Rating] Disable plugin on pages and certain posts (6 posts)

  1. jssssperr
    Member
    Posted 6 months ago #

    This plugin is simple and does what it's supposed to do. However, I'm trying to figure out how to get more control over where the plugin is displayed. It shows up on pages as well as posts, which I don't need. I also don't want it to show up on certain posts (sticky posts and posts in the "news" category). I've been looking through the code to see if there's somewhere I can insert a conditional to make this happen, but (as a newcomer to php) my experiments have so far been unfruitful.

    Any suggestions would be greatly appreciated.

  2. jssssperr
    Member
    Posted 6 months ago #

    I'm still stumped. This plugin doesn't require me to insert any tags into the theme, so I can't simply throw a conditional around something like that.

    At the end of the plugin code, there's this:

    $PostRating = new PostRating();
    add_action('wp_head', array(&$PostRating, 'Initialization'));
    add_action('plugins_loaded', array(&$PostRating, 'LoadExtensions'));
    add_action('the_content', array(&$PostRating, 'RatingLinks'));
    add_action('wp_footer', array(&$PostRating, 'VisitorCredits'));

    which I assume is what actually loads the voting links onto the posts/pages. I tried wrapping that in a conditional like this:

    if (!is_page() || !is_sticky()){
    $PostRating = new PostRating();
    add_action('wp_head', array(&$PostRating, 'Initialization'));
    add_action('plugins_loaded', array(&$PostRating, 'LoadExtensions'));
    add_action('the_content', array(&$PostRating, 'RatingLinks'));
    add_action('wp_footer', array(&$PostRating, 'VisitorCredits'));
    }

    The revised plugin saved fine, but my website displayed no visible change. I then tried wrapping the entirety of the plugin (the entire php tag) in the same condition, and still nothing changed. Any ideas?

  3. jssssperr
    Member
    Posted 6 months ago #

    Just now, I also tried adding the condition to the individual functions (Initialization, LoadExtensions, RatingLinks, and VisitorCredits). Same thing, no change. :/

  4. sagelike
    Member
    Posted 4 months ago #

    I like the plugin but it disabled my tinymce editor. Whichever tab was active when activated (Visual|HTML) is the tab it gets stuck on.

    It happened with 2.8 and 2.8.2. Strange!

  5. rauuul1
    Member
    Posted 1 month ago #

    bump, i have the same question?

  6. metapix@gmail.com
    Member
    Posted 1 month ago #


Reply

You must log in to post.

About this Topic