Support » Plugin: WordPress Popular Posts » adding category parameter returns first ever posts in categor

  • If I add the “cat” parameter when using the shortcode or function call, WPP returns the first posts ever posted in that category – not the popular posts. As soon as the cat parameter is removed, it works correctly.

    I’ve tried both the shortcode, like this:

    echo do_shortcode('[wpp cat="'.$term_id.'" thumbnail_width="300" thumbnail_height="300" limit="10" range="monthly"]')

    And the function call, like this:

    wpp_get_mostpopular("range=monthly&cat=$term_id&thumbnail_width=300&thumbnail_height=300&limit=10")

    I’ve confirmed that $term_id is returning the correct integer for the term ID. I’ve even tried and explicit cast to a string, like this:

    wpp_get_mostpopular("range=monthly&cat=" . (string)$term_id . "&thumbnail_width=300&thumbnail_height=300&limit=10")

    Please could you let me know if I’m going wrong somewhere? I’ve searched the forum, wiki & FAQ without any luck.

    Thanks
    Andy

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

  • The topic ‘adding category parameter returns first ever posts in categor’ is closed to new replies.