WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
Most Popular Section with WPP Plugin - Implementation? (1 post)

  1. guitargeek_com
    Member
    Posted 5 months ago #

    Hello WPP,

    I'm displaying a Popular Post Section that is sorted by the most Comments. I'd like to integrate WPP and display the posts by Page Views. I'm running up against formatting and CSS styling issue when using WPP.

    Here's the current code for the "Popular" posts:

    <!-- Most Popular  -->
    	<div class="middle_col">
    
    	<h5>Most Popular</h5>
    
    	        <ul>
    		<?php $pc = new WP_Query('orderby=comment_count&posts_per_page=10=&cat=8'); ?>
                             <?php while ($pc->have_posts()) : $pc->the_post(); ?>
                                  <?php
    			 $thetitle = $post->post_title; /* or you can use get_the_title() */
    			 $getlength = strlen($thetitle);
    			 $thelength = 42;
    		          ?>
    	                            <li style="list-style: none;"><div class="thumbnail-small"><?php the_post_thumbnail(); ?></div><span class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php echo substr($thetitle, 0, $thelength); if ($getlength > $thelength) echo "..."; ?></a></span><br />
    		<span class="meta">
                               <?php comments_popup_link('No Comments Yet', '1 Comment', '%  Comments'); ?></span></li>
                                       <?php endwhile; ?>
    				</ul>
    			</div>
    <!-- // Most Popular -->

    What do I need to change in order to make this work with WPP?

    I'm guessing the following bits of code need to be changed in order to work:

    <?php $pc = new WP_Query('orderby=comment_count&posts_per_page=10=&cat=8'); ?>

    AND

    <?php comments_popup_link('No Comments Yet', '1 Comment', '% Comments'); ?>

    The site is at http://www.guitargeek.com

    Any help appreciated...

    Adam

    https://wordpress.org/plugins/wordpress-popular-posts/

Reply

You must log in to post.

About this Plugin

About this Topic