WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
using Template Tags in sidebar list (11 posts)

  1. blissfule
    Member
    Posted 2 years ago #

    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/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    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;}

  3. blissfule
    Member
    Posted 2 years ago #

    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!

    • blissfule
      Member
      Posted 2 years ago #

      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.

    • blissfule
      Member
      Posted 2 years ago #

      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?

    • Héctor Cabrera
      Member
      Plugin Author

      Posted 2 years ago #

      Hi Elisa,

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

    • blissfule
      Member
      Posted 2 years ago #

      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.

    • blissfule
      Member
      Posted 2 years ago #

      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!

    • blissfule
      Member
      Posted 2 years ago #

      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!

    • blissfule
      Member
      Posted 2 years ago #

      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/

    • Héctor Cabrera
      Member
      Plugin Author

      Posted 2 years ago #

      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!

    Topic Closed

    This topic has been closed to new replies.

    About this Plugin

    About this Topic