In response to your first question, you can show only posts by editing the popularity-contest.php file. Around the line 1377 there’s the following MySQL query:
$posts = $wpdb->get_results("
SELECT ID, post_title
FROM $wpdb->posts
LEFT JOIN $wpdb->ak_popularity pop
ON $wpdb->posts.ID = pop.post_id
$join
WHERE post_status = 'publish'
AND post_date < NOW()
$where
$groupby
ORDER BY pop.total DESC
LIMIT ".intval($limit)
);
That needs to be replaced by the following:
$posts = $wpdb->get_results("
SELECT ID, post_title
FROM $wpdb->posts
LEFT JOIN $wpdb->ak_popularity pop
ON $wpdb->posts.ID = pop.post_id
$join
WHERE post_status = 'publish'
AND post_date < NOW()
AND post_type = 'post'
$where
$groupby
ORDER BY pop.total DESC
LIMIT ".intval($limit)
);
The key here being the “AND post_type = ‘post'” bit which tells the plugin to look just for posts and not pages.
That’ll make the akpc_most_popular(); function show only posts, and not pages.
As for your second question… again, you’ll have to edit the plugin file around the line 1651. Changing this:
if (is_feed() || is_admin_page() || get_post_meta($post->ID, 'hide_popularity', true) || !$show) {
for this:
if (is_feed() || is_admin_page() || get_post_meta($post->ID, 'hide_popularity', true) || !$show || is_page()) {
The key being “|| is_page()” which prevents the popularity to appear on pages. They will still appear on posts though.
Hope that helps!