• 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)
  • Plugin Author frasten

    (@frasten)

    Hi, thank you for reporting, I’ll look into this as soon as I can (I’m graduating next week!) ??

    Thread Starter Geetar

    (@geetar)

    Hi frasten! I wish you good luck on your graduation!

    Thread Starter Geetar

    (@geetar)

    Hi frasten, can you help me please?

    Regards ??

    Plugin Author frasten

    (@frasten)

    Hi, could you paste your full code in your sidebar.php? This code is missing some important portions.
    You could use some free service as https://www.pastie.org/ that also allows PHP syntax highlighting. (then paste your resulting url here!)

    However you could try and add this code:
    <?php if (function_exists('WPPP_show_popular_posts')) WPPP_show_popular_posts(); ?>
    just after your </ul> in the end.
    However, this depends on your theme.
    Could you test if it is working for you?
    Thank you! ??

    Thread Starter Geetar

    (@geetar)

    Hi frasten, thanks for your quick reply!

    I’ve tried to add this code <?php if (function_exists('WPPP_show_popular_posts')) WPPP_show_popular_posts(); ?> without any luck.

    Here’s the full sidebar code, Popular posts is around line 71, after <a name="popular" id="popular"></a>

    https://www.pastie.org/1210252

    I really want to use your plugin, since is the best out there.

    Thank you very much for your help

    Thread Starter Geetar

    (@geetar)

    Hey frasten! Any news about the code?

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.