Title: Popularity Contest Plugin (beta)
Last modified: August 18, 2016

---

# Popularity Contest Plugin (beta)

 *  [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/)
 * The details: [http://www.alexking.org/blog/2005/05/23/popularity-contest/](http://www.alexking.org/blog/2005/05/23/popularity-contest/)
 * Please post bug reports and support questions here.

Viewing 15 replies - 1 through 15 (of 57 total)

1 [2](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/4/?output_format=md)
[→](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/2/?output_format=md)

 *  [normgregory](https://wordpress.org/support/users/normgregory/)
 * (@normgregory)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-208998)
 * At the bottom of the Most Popular Posts page I got this error message:
 * Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/normgregory.
   com/subdomains/blog/httpdocs/wp-content/plugins/popularity-contest.php on line
   941
 *  [xerocool](https://wordpress.org/support/users/xerocool/)
 * (@xerocool)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209006)
 * Same here.
 * I get 2:
 * Warning: Invalid argument supplied for foreach() in /usr/home/xerocool/domains/
   r0x0rz.info/public_html/wp-content/plugins/popularity-contest.php on line 710
 * and:
    /usr/home/xerocool/domains/r0x0rz.info/public_html/wp-content/plugins/popularity-
   contest.php on line 710
 * and:
    /usr/home/xerocool/domains/r0x0rz.info/public_html/wp-content/plugins/popularity-
   contest.php on line 940
 * I meant 3 ;).
 *  Thread Starter [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209031)
 * Thanks, easy fix for next release. Looks like you have some categories without
   posts.
 *  [Arlo](https://wordpress.org/support/users/arlo/)
 * (@arlo)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209050)
 * How do I turn off showing the % in all the posts? I would only want to use it
   in the sidebar.
 * edit: nevermind..it helps to read the source 🙂
 *  Thread Starter [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209051)
 * From the README.txt:
 * > …read the installation instructions at the top of the plugin to disable showing
   > popularity for each post.
 *  [Arlo](https://wordpress.org/support/users/arlo/)
 * (@arlo)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209056)
 * I got these errors in the report page:
 * WordPress database error: [Got error 12 from storage engine]
    SELECT DISTINCT
   c.cat_name AS cat_name, AVG(pop.total) AS avg FROM wp_posts p LEFT JOIN wp_ak_popularity
   pop ON p.ID = pop.post_id LEFT JOIN wp_post2cat pc ON p.ID = pc.post_id LEFT 
   JOIN wp_categories c ON pc.category_id = c.cat_ID GROUP BY c.cat_ID ORDER BY 
   avg DESC
 * Warning: Invalid argument supplied for foreach() in /www/a/automatorwor/htdocs/
   wordpress/wp-content/plugins/popularity-contest.php on line 754
    WordPress database
   error: [Got error 12 from storage engine] SELECT MONTH(p.post_date) AS month,
   AVG(pop.total) AS avg FROM wp_posts p LEFT JOIN wp_ak_popularity pop ON p.ID 
   = pop.post_id WHERE YEAR(p.post_date) = ‘2005’ GROUP BY month ORDER BY avg DESC
 * Warning: Invalid argument supplied for foreach() in /www/a/automatorwor/htdocs/
   wordpress/wp-content/plugins/popularity-contest.php on line 774
    WordPress database
   error: [Got error 12 from storage engine] SELECT MONTH(p.post_date) AS month,
   AVG(pop.total) AS avg FROM wp_posts p LEFT JOIN wp_ak_popularity pop ON p.ID 
   = pop.post_id WHERE YEAR(p.post_date) = ‘2004’ GROUP BY month ORDER BY avg DESC
 * Warning: Invalid argument supplied for foreach() in /www/a/automatorwor/htdocs/
   wordpress/wp-content/plugins/popularity-contest.php on line 774
 *  Thread Starter [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209057)
 * Interesting – can you run that top SQL query on the database directly and let
   me know what the error from MySQL is?
 *  [Arlo](https://wordpress.org/support/users/arlo/)
 * (@arlo)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209062)
 * weird– I restarted the plugin and they’re gone now (I am still getting the two
   errors already described above).
 * This is working well for me now– quesiton: I’m using it in my sidebar like this,
   which gives me a nice “top 10” ordered list of posts in category 1. :
    `<ol><
   php akpc_most_popular_in_cat(10,'<li>','</li>',1); ?></ol>`
 * I have a number of subcategories under a top-level category that doesn’t have
   the posts explicitly attached to them–as a way method to have an “invisible” 
   category. Is there a way to use the top level cat and have all the sub-cats show
   in the list? Short of this, could there be a way to include multiple categories?
 *  Thread Starter [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209069)
 * The example code included in sidebar.php makes it easy to make the list ‘category
   aware’ for a single category. However, there is no concept of showing multiple
   categories in the current code.
 * Feel free to add/edit as you like – it shouldn’t be hard to modify.
 *  [Arlo](https://wordpress.org/support/users/arlo/)
 * (@arlo)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209083)
 * Easy for you to say, I’m not a coder 🙂
 * I’m setting up some conditional bits which mostly work, but “is_home” is going
   utterly ignored–it’s returning nothing on the home page, but “is_page” and “is_single”
   work fine:
 *  `<php if (is_home() || is_page() || is_single()) { ?>
    <php akpc_most_popular_in_cat(
   10,'<li>','</li>',61); ?>
 *  <php } elseif (is_category()) { ?>
    <php akpc_most_popular_in_cat(10,'<li>','
   </li>'); ?>
 *  <php } elseif (is_month()) { ?>
    <php akpc_most_popular_in_month(10,'<li>','
   </li>'); ?> <php } ?>
 * Ideas?
 *  [karb](https://wordpress.org/support/users/karb/)
 * (@karb)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209140)
 * Hi there,
 * Great plugin
    I too have the errors mention and yes I have categories not used.
   I also get it for ‘Last Year’ – Warning: Invalid argument supplied for foreach()
   in /home/editor/public_html/news/wp-content/plugins/popularity-contest.php on
   line 940
 * How do you limit ‘most popular posts’ in the side bar please?
 * Thanks
 *  [cou](https://wordpress.org/support/users/cou/)
 * (@cou)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209154)
 * Was looking forward to using this, but for some reason it’s altered something.
   My site now only displays one post per page – it has the “next page” links, but
   still only one post at a time. No other settings have been changed, no other 
   files – deactivated the plugin, and deleted it from the server.
 * Ideas welcome, please! Can’t think what has [gone wrong](http://www.cricket.mailliw.com).
 *  [wildduck](https://wordpress.org/support/users/wildduck/)
 * (@wildduck)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209156)
 * Hi Alex
    Great plugin
 * I have the Line 940 error too
 * Keep coding !
 *  [karb](https://wordpress.org/support/users/karb/)
 * (@karb)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209161)
 * Does this screw up feeds as my feedburner link no longer works I get: Error on
   line -1: Premature end of file. on Feedburner or do you think that is unrelated?
 * Thanks
 *  Thread Starter [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/#post-209175)
 * cou – I don’t see the problem you describe on your site
 * Karb – I don’t see why it would hurt your feeds, however I’ve changed the plugin
   for the next release so that it doesn’t show popularity in the feeeds. I don’t
   think I understand you sidebar question.

Viewing 15 replies - 1 through 15 (of 57 total)

1 [2](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/4/?output_format=md)
[→](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/2/?output_format=md)

The topic ‘Popularity Contest Plugin (beta)’ is closed to new replies.

## Tags

 * [alex](https://wordpress.org/support/topic-tag/alex/)

 * 57 replies
 * 15 participants
 * Last reply from: [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/popularity-contest-plugin-beta/page/4/#post-209316)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
