• Resolved BHUGE

    (@bhuge)


    Hi there,

    First of all: great plugin!

    I currently have an “issue”. This is my situation:
    On my front page i’m showing the most viewed posts (4 in total).
    Beneath the popular posts i’m showing newly created posts.

    I’ve altered the popular posts html with this filter:
    add_filter(‘wpp_custom_html’, ‘alter_popular_posts_html_output’, 10, 2);

    What i would like to achieve is the following:
    Exclude all popular posts from the second query on the front page. I’ve looked over the docs on Github but could’nt find a helper function to get only the popular post id’s based on views.

    Is there something available?

    Many thanks in advance.

    • This topic was modified 3 years, 5 months ago by BHUGE.
Viewing 1 replies (of 1 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there,

    First of all: great plugin!

    Thanks!

    What i would like to achieve is the following:
    Exclude all popular posts from the second query on the front page. I’ve looked over the docs on Github but could’nt find a helper function to get only the popular post id’s based on views.

    Is there something available?

    This would be the closest thing, except you need to replace WPP_Query with WordPressPopularPosts\Query.

    That class will get you an array of popular posts objects. You can loop said array to get the IDs and store them in an array, then use this array however you like.

Viewing 1 replies (of 1 total)
  • The topic ‘Helper function to get popular post ID’s’ is closed to new replies.