Post Voting: Can you activate for certain categories only?

Is is possible to activate/deactive the Post Voting Plugin for selected categories of posts?

As an example, I would like to have the Post Voting Plugin visible for 2 categories only. I don’t want the option to vote to show on other posts. Can this be done?

  • DavidM
    • DEV MAN’s Mascot

    Hi avonnes,

    Currently it wouldn’t be possible as an option in the plugin itself, but that can be done with a bit of custom coding, possibly easiest done using the template tags documented in the plugin’s settings page.

    As an example, you could use the following in your theme’s single.php file to display the voting options only if the post category’s id is 3:

    <?php if ( in_category('3') ) { wdpv_vote(); } ?>

    You could also post this as a feature request in the following forum:

    https://premium.wpmudev.org/forums/forum/feature-suggestions

    Hope that helps!

    -David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.