• Resolved wpmhweb

    (@wppit)


    I need to show the the popular posts for a particular tag (not category), how do I do this?

    Thanks,

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

    (@hcabrera)

    Hey there,

    Assuming you’re using the widget, this might help.

    Thread Starter wpmhweb

    (@wppit)

    In the homepage, i’m using something like this:

    <?php
    $args = array(
    'range' => 'weekly',
    'freshness' => 1,
    'order_by' => 'views',
    'limit' => 3,
    'post_type' => 'post',   
    'stats_author' => 1,
    );
    
    if (function_exists('wpp_get_mostpopular'))
    									wpp_get_mostpopular( $args );
    ?>

    Now I just need to do something similar but to show the popular post for a tag, not a category.

    Thanks,

    Plugin Author Hector Cabrera

    (@hcabrera)

    Use taxonomy and term_id:

    $args = array(
        ...
        'taxonomy' => 'post_tag',
        'term_id' => '17',
        ...
    );

    For more details, please check Dashboard > Settings > WordPress Popular Posts > Parameters.

    Thread Starter wpmhweb

    (@wppit)

    Thank you very much. I’ve wanting to do this for a long time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do I display popular post from tags, not cats?’ is closed to new replies.