Support » Plugin: WordPress Popular Posts » [Plugin: WordPress Popular Posts] How to display category and tag

  • Resolved Max Human



    Installed the plugin – works fine. But when I started to customize HTML Wrapper, faced with a problem – I can not display the category tags and posts.
    Settings in the file: wordpress-popular-posts.php

    And again, because the plug-in counts display – perhaps as a display that value in the category. Only the number of views …

    Thank you!

    WP 3.4.1 + WPP 2.3.1

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Héctor Cabrera


    Hi Max,

    Currently, there’s no way to achieve that. The plugin doesn’t collect this info at the moment, but chances are that it will be included (along with other things) on future versions.

    I hope that the ability to display Categories and Tags appear in the nearest update. Since this is a very logical and often claimed, when dealing with the post.

    Thank, Héctor

    And yet, on the display of views (hosts) … It should be possible to deduce the value to other pages, even if in these pages do not use the plugin.

    Explain why – if I put a list of popular posts on the main page, and where it is displayed in the block views, such as 100. Then that would bring the number of views of the same date, the list of posts in the categories – I need to create a separate counter. I think it will be difficult to synchronize the counters that have all had the same views…

    Something like this 🙂

    Plugin Author Héctor Cabrera


    Will do what I can, don’t worry.

    I didn’t get that last post of yours. Can you please rephrase that?

    When I need to display on the website a list of popular posts – I use the widget. This list shows the 5 posts all sorted according to specific criteria. In the stream of shows: thumbnail image, the title, the first 300 characters, Number of comments, views Number, date of publication.

    Displaying the number of views provides the $pageviews, in the file: wordpress-popular-posts.php If I understand correctly, the value for the $pageviews where it is stored.
    The idea is that it would be possible to display the value in any other place on the site – in the category page that displays the list of posts.

    Why do it? When I display the main page list of popular recordings, its HTML wrapper is the same as for the list, the category page. But the difference is that in terms of a list of standard conditions means WordPress and they is not designed for counting the number of hits.

    In order to HTML wrapper popular posts was the same on the home page and a list of posts in the categories on the search page, the page tag …

    Simply put, how to insert the value of this variable (counter) on category pages, search pages, tag pages?
    Hope to understand, – and I do not know English …:))

    Plugin Author Héctor Cabrera


    Ah, I see. I think I get it now. What you want is to display the views count in other places. Is that correct? If so, you can use the wpp_get_views() template tag. It requires the post ID passed as a parameter in order to work, here’s an example:

    In the loop:

    <?php echo wpp_get_views($post->ID); ?> view(s)

    Outside the loop:

    <?php echo wpp_get_views(your-post-ID-here); ?> view(s)

    Thanks, this is what we need!
    Waiting in the near plugins updates, the ability to add to wordpress-popular-posts.php in html wrapper, the functions of $posttag and $postcategory

    Thank you very much for your support!

    Hector, show you how to properly use wpp_get_views($post->ID), the printf function. Here is an example Number of comments:

    printf( _n( '', '<span>%1$s</span>', get_comments_number(), 'twentyeleven' ) , number_format_i18n( get_comments_number() ) );
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WordPress Popular Posts] How to display category and tag’ is closed to new replies.