• Resolved w3riyad

    (@w3riyad)


    Hello,

    Great plugin!

    I’m trying to display today most viewed post with desc order. i tries this shortcode
    [display-posts posts_per_page=”10″ wrapper=”ul” wrapper_class=”latest_news_style” date_query_after=”-1 days” date_column=”post_modified” orderby=”meta_value_num” meta_key=”post_views_count” order=”DESC”]

Viewing 1 replies (of 1 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    How is the post_views_count meta key being set? Are you manually updating that on every pageview or using a plugin to do so?

    Everything looks right in your shortcode. What results are you seeing? Try removing the orderby="meta_value_num" meta_key="post_views_count" part to see if your issue is with that key not existing.

    A better approach would be to use the Stats module inside Jetpack to collect stats, along with BE Stats which adds the stats data as post meta.

    You can then use this shortcode: [display-posts orderby=”popular”]

    The only problem is you won’t likely have stats on posts published today. BE Stats refreshes every 24 hours and it can take a few hours for visits to show up in Jetpack Stats.

    A good percentage of posts created in the last 24 hours likely won’t have any stats data. You’re using the modified date though so those might have more historical data attached to them.

Viewing 1 replies (of 1 total)
  • The topic ‘Display today most viewed post desc order’ is closed to new replies.