• Hello!

    I am trying to implement a custom polling or survey system, and I would like to ask for a little help regarding that.

    I have created a custom post type, where I would need a way that every user can vote once/custom post, and there is always 3 possible things to vote for. Of course I need counting the number of votes too

    I have found a possible solution but hit a roadblock, so if you know a plugin which would allow me to do the things described above, that would be awesome!

    My roadblock:
    I have found this article which I am currently trying to modify to my needs:
    http://gabrieleromanato.name/implementing-an-ajax-like-system-on-wordpress-posts/

    I have modified the update action and the display action for my needs, but I am stuck with the “Now we can write our jQuery code to handle the AJAX request:” part. Where do I put in that jquery code? Into functions.php?

    Thank you very much for your help! I greatly appreciate it!

Viewing 1 replies (of 1 total)
  • Custom post types and taxonomies should always be registered in a plugin, not in a theme, so you can switch themes later, and the current theme stay as clean as possible. So the JavaScript code should go to the same plugin that you are using to register the post type.

    On how to do that: See What’s the preferred method of writing AJAX-enabled plugins?

    If you get stuck again, poste the code that you have already. It is alway easier to help on specfic code.

Viewing 1 replies (of 1 total)
  • The topic ‘Trying to implement custom voting/survey’ is closed to new replies.