can we limit voting on specific post categories

I would like to limit the voting only to categories that contain nominees for an award. Remaining categories will be for generic posts. can this be done, if so how.

  • Vaughan

    Hi @coleen,

    currently this isn't possible. There is no option to select the categories that the plugin uses, this would require quite a bit of custom coding.

    I suppose you could edit the inject_voting_buttons function in class_wdpv_public_pages.php file

    Then add $category = get_the_category(); to the function to detect the post category.

    I haven't been able to get this to work though, I can ask one of our developers to see if he can come up with a quick fix, but if it's too complex, you might be best to advertise for a developer over at our jobs board. https://premium.wpmudev.org/wordpress-development/

    I can certainly add this as a feature request for a future release though.

    Hope this helps

  • Vaughan

    Hi @coleen,

    You will need to discuss this with our billing department, We are not able to deal with billing enquiries on the forum.

    You can contact them using the below link.

    https://premium.wpmudev.org/contact/

    Incidently, There is an easier method I have found, but it would still require some editing of your theme templates, single.php for instance.

    Then you can use the template tags in the template.

    So in your single.php use the tag

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

    Which would then only allow voting if the category id is 3.

    Or you can use the shortcodes on a page.

    [wdpv_vote]

    Then set the option in the settings for manual placement. The voting would just appear on those pages then with the shortcode.

    Sorry, I didn't mention this before, as I wasn't as familiar with the options available in the plugin, but it is possible after looking into this further.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.