• Resolved owenpiccirillo

    (@owenpiccirillo)


    Hello,

    I am trying to show the popular categories in the main nav of the website.

    wpp_get_mostpopular('stats_category=1&limit=20&post_html="<li>{category}</li>"');

    This shows the links correctly, but I only want to show a category once.

    This shows multiple categoys..

    So for examples… this shows..

    <!-- WordPress Popular Posts Plugin v3.3.3 [PHP] [daily] [views] [custom] -->
    
    <ul class="wpp-list">
    
    <li><a href="#">Gaming</a></li>
    <li><a href="#">Travel</a></li>
    <li><a href="#">Technology</a></li>
    <li><a href="#">Gaming</a></li>
    <li><a href="#">Health</a></li>
    <li><a href="#">Technology</a></li>
    <li><a href="#">Gaming</a></li>
    <li><a href="#">Business</a></li>
    <li><a href="#">Travel</a></li>
    <li><a href="#">Health</a></li>
    <li><a href="#">Art</a></li>
    <li><a href="#">Business</a></li>
    <li><a href="#">Zz.Sticky</a></li>
    <li><a href="#">Food</a></li>
    <li><a href="#">Food</a></li>
    <li><a href="#">Marijuana</a></li>
    <li><a href="#">Travel</a></li>
    <li><a href="#">Culture</a></li>
    <li><a href="#">Culture</a></li>
    <li><a href="#">Art</a></li>
    <!-- End WordPress Popular Posts Plugin v3.3.3 -->
    
    I want it to only show
    
    <!-- WordPress Popular Posts Plugin v3.3.3 [PHP] [daily] [views] [custom] -->
    
    <ul class="wpp-list">
    
    <li><a href="#">Gaming</a></li>
    <li><a href="#">Travel</a></li>
    <li><a href="#">Technology</a></li>
    <li><a href="#">Health</a></li>
    <li><a href="#">Business</a></li>
    <li><a href="#">Art</a></li>
    <li><a href="#">Zz.Sticky</a></li>
    <li><a href="#">Food</a></li>
    <li><a href="#">Marijuana</a></li>
    <li><a href="#">Culture</a></li>
    <!-- End WordPress Popular Posts Plugin v3.3.3 -->

    Can this be done? Thanks!

    https://wordpress.org/plugins/wordpress-popular-posts/

Viewing 1 replies (of 1 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there!

    The wpp_get_mostpopular() template tag displays a list of posts -as stated in the documentation- which is why you’re seeing several of your categories appearing more than once: these are the categories of each popular post.

    Displaying a list of popular categories isn’t possible at this time as such feature doesn’t exist.

Viewing 1 replies (of 1 total)
  • The topic ‘Show only Category title, but not duplicates’ is closed to new replies.