Search code examples
wordpresspluginspolling

A Poll That Is Auto Created For Each Post in Wordpress


I'm looking to have a poll at the end of each of our posts that the viewer can vote on. I don't want to have to manually create a poll for each post.
The only plugins I can find are star ratings. We're looking for a custom poll that asks something like "Would you consider this article: Pro This, Anti This or Right in the Middle". Otherwise I have to create a unique poll for each post and manually insert. We're planning on having dozens of new posts a day.
I've been searching everywhere and cannot find anything like this. I'm hoping someone has a recommendation.


Solution

  • Like I wrote in the comment, you can easily achieve what you want in several ways. For example :

    1. Create child theme ( create custom single.php or post.phpor any other alternative )
    2. Create a child theme with a custom function in functions.php ( see below )
    3. create own plugin with custom function and use the_content filter ( see below )
    function whateverContentYouWant($content) {
            if(!is_feed() && !is_home()) { // your conditions if any 
                    $content.= "Enjoyed this article?"; // add your content here
            }
            return $content;
    }
    add_filter ('the_content', 'whateverContentYouWant');
    

    That being said, I am not sure this site is the best place to search plugin recommendations. better if you have a more specific code-related issues ( with examples )