Vote It Up – Most Voted Page
-
So I have a coding challenge.
I downloaded the Vote It Up plugin which works well. I want users to be able to vote on posts.
However, I need to create a page with the most voted posts only, that automatically updates when new votes are cast.
Here is my site:
<a href="https://www.tendig.com">www.tendig.com </a> Also, here is some code from my page with the vote it up plugin. I can provide more if needed. I am assuming I need to make a copy of my page.php, then rename it as mostvoted.php, and add the code into that? However, I don't know how to have the code get the most voted posts. Here is my page.php: <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post page" id="post-<?php the_ID(); ?>"> <h2 class="page_title"><?php the_title(); ?></h2> <div class="entry entry_page"> <?php the_content('<p class="serif">Read the rest of this page ?</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> </div> </div> <?php endwhile; endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> Here is my single.php which includes the getvote function about halfway down: <?php get_header(); ?> <div id="content" class="narrowcolumn"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="history.go(-1)">Go Back</a></p></br> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <div class="post_top"> <div class="post_title"> <h2><?php the_title(); ?></h2> </div> <?php if($post->comment_count>0) : ?><div class="post_comm"><?php comments_popup_link('0', '1', '%'); ?></div><?php endif; ?> <div class="post_top_data"> <p class="post_author"><span></p><?php the_author() ?></span> | Posted on <?php the_time('d-m-Y') ?><p class="post_cats">Category : <span><?php the_category(', ') ?></span></p> <?php the_tags('<p class="post_tags">Tags: <span>', ', ', '</span></p>'); ?> </div> </div> <div class="entry"> <?php $ad_post_text_300_250 = obwp_get_meta(SHORTNAME."_ad_post_text_300_250"); if(!empty($ad_post_text_300_250)) { echo '<div class="banner_left">'.$ad_post_text_300_250.'</div>'; } ?> <?php DisplayVotes(get_the_ID()); ?><?php the_content('...Read the entire entry',FALSE,''); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php $ad_footer_post_468_60 = obwp_get_meta(SHORTNAME."_ad_footer_post_468_60"); if(!empty($ad_footer_post_468_60)) { echo '<div class="banner">'.$ad_footer_post_468_60.'</div>'; } ?> </div> </div> <a href="history.go(-1)">Go Back</a></p></br><?php comments_template(); ?> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
Is this possible to do?
Thanks,
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Vote It Up – Most Voted Page’ is closed to new replies.