[Plugin: WordPress.com Popular Posts] Implement the plugin on the sidebar
-
Hi,
How to change the following code in order to display WordPress.com Popular Posts? I’m not good with PHP.
<a name="popular" id="popular"></a> <ul id="tab-pop" class="list" style="display: block; "> <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title,post_excerpt FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 8"); foreach ($result as $post) { setup_postdata($post); $postid = $post->ID; $title = $post->post_title; $commentcount = $post->comment_count; if ($commentcount != 0) { ?> <li><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"> <?php if ( get_post_meta($post->ID, 'Thumbnail', true) ) { ?><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, "Thumbnail", $single = true); ?>&w=120&h=68&zc=1" alt="<?php the_title(); ?>" /></a><?php } ?></a> <a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>" class="tabtitle"> <?php if ( strlen($title)> 32 ) { echo substr( $title, 0, 32 ). "..."; } else { echo $title; } ?> </a> <div class="desc"><?php if (get_the_excerpt() != "") { echo limit_words(get_the_excerpt(), '30'). "..."; } else { echo limit_words(the_excerpt(), '30'). "..."; } ?></div> <div class="meta"><?php the_time('l, F j, Y'); ?> <?php the_time('G:i'); ?> - <a href="<?php comments_link(); ?>"><?php echo $commentcount ?> Comment(s)</a></div> <div class="fix"></div> </li><hr /> <?php } } ?> </ul> </div> <div>
Thanks in advance
https://www.ads-software.com/extend/plugins/wordpresscom-popular-posts/
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘[Plugin: WordPress.com Popular Posts] Implement the plugin on the sidebar’ is closed to new replies.