WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WordPress Popular Posts] using Template Tags in sidebar list

[Plugin: WordPress Popular Posts] using Template Tags in sidebar list

  • I would like to know if the following code will produce a list in my sidebar (I am using the Fervens Remix theme):

    <ul id="p-posts">
    <?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular("range=all&order_by=views&stats_comments=0&title_length=100"); ?>
    </ul>

    In case it helps, the relevant css is:

    .s2 .recent #p-posts li { padding: 3px 0px; border-bottom: solid 1px #b0bf32; background: url(images/recent-arrow.png) no-repeat left 7px; padding-left: 10px;}

    I want the above popular posts code to work like this section for recent posts:

    <ul id="r-posts">
    <?php $posts = get_posts("numberposts=10&orderby=post_date&order=DESC"); foreach($posts as $post) : ?>
      <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>

    My site is http://blissfule.me. I appreciate your help or pointing me to a relevant PHP tutorial. Thank you!

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Hector Cabrera
    Participant

    @hcabrera

    Hi blissfule,

    Try this:

    <?php
    if (function_exists('wpp_get_mostpopular')) { ?>
    <div id="mypopularposts">
    <?php
    wpp_get_mostpopular("range=all&order_by=views&stats_comments=0&title_length=100");
    ?>
    </div>
    <?php
    }
    ?>

    …and then, change your css to something like:

    .s2 .recent #p-posts li, #mypopularposts ul li { padding: 3px 0px; border-bottom: solid 1px #b0bf32; background: url(images/recent-arrow.png) no-repeat left 7px; padding-left: 10px;}

    Thank you for your reply, Héctor.

    At first when I put in the code, nothing happened when I clicked the link to the popular posts on my blog. After looking at it, I tried enclosing your code in

      tags and the link began functioning normally.

      However, I am getting the “Sorry. No data so far.” error, so I will wait patiently until I receive enough hits to see if the list is formatted correctly.

      Thank you again for your help, and I will report back when there is enough data to see if it’s all working as we hope!

      Sorry – I forgot to enclose my code properly above. It should read,

      After looking at it, I tried enclosing your code in
      <ul></ul>
      tags and the link began functioning normally.

      Still no results on this because I’m still getting the error message “Sorry. No data so far.”

      I’m receiving about 80 hits per day on my site… How long should it be before I see data using this plugin?

      Plugin Author Hector Cabrera
      Participant

      @hcabrera

      Hi Elisa,

      Just checked your site and can’t find the WPP widget. Please add it back so I can run some tests, alright?

      Hi Héctor,

      Thanks for looking into this. I have popped the widget back on the sidebar, just below the collapsible archive.

      If you’d prefer to run tests with it up above in the green box where I want it to end up, just let me know and I can put it there.

      Hi Héctor,

      Were you able to run tests to see what’s happening with the widget on my site?

      Let me know if you need anything from me in order to find out what’s going on.

      Thanks!

      Me again – I know you’re busy. Do you think you’ll have a chance to look at why I’m not getting any data from this plugin on my site? http://blissfule.me

      Thanks!

      Decided to use a non-plugin solution instead. I found the solution here: http://www.bin-co.com/blog/2009/03/show-popular-posts-in-wordpress-without-a-plugin/

      Plugin Author Hector Cabrera
      Participant

      @hcabrera

      Hi blissfule,

      Sorry for not replying earlier. I believe I’ve found the reason why no data were being recorded on your site and I’m already working on a fix. A new update should be coming soon, and hopefully my plugin should work on your site as expected.

      Again, sorry for the long delay!

    Viewing 10 replies - 1 through 10 (of 10 total)
    • The topic ‘[Plugin: WordPress Popular Posts] using Template Tags in sidebar list’ is closed to new replies.