WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Making a unique vote post plugin per category (2 posts)

  1. zync09
    Member
    Posted 1 year ago #

    Hi all,

    I'm a newish wordpress developer just looking to get some insight on how I could go about making this plugin.

    I need to be able to let a user vote of a particular post in a category. Once they have voted, they can shift their vote to another post in that category, but never vote more than once per categry.

    I'm guessing it would involve adding meta data per user that checks if a vote has been added in a particular category using the add_user_meta method, but not sure how to exactly flesh it out and where. Ie make a plugin or just add it into functions.php

    So for example:

    Cat1
    --Post1 (user Vote)
    --Post2

    Cat2
    --Post1
    --Post2 (user vote)
    --Post3

    In Cat 2, if the user votes on Post3 later, it will shift the vote from post2 to post3 and not keep the old vote. Any help would be greatly appreciated and I'll send cookies

  2. zync09
    Member
    Posted 1 year ago #

    Nevermind, built a plugin adding the category slug as a meta_key and then the post id as a value for a user and then then did a tally up running through a user loop. Problem solved

Topic Closed

This topic has been closed to new replies.

About this Topic