Support » Plugins and Hacks » Problem in sorting _count-views_all

Problem in sorting _count-views_all

  • Hi!

    I’m writing a sort function and I’m having a little problem with this argument “_count-views_all”.

    I’m trying to put this “&meta_key=_count-views_all&orderby=meta_value_num&order=DESC” inside query_posts() and to receive sorting category by the most views posts.

    The problem is that it is showing only the post with minimum 1 view I think its because the postmeta table receive the _count-views_all row after 1 view and if the value is 0 there is no row for the post.

    Any Idea?


Viewing 1 replies (of 1 total)
  • I’m having this same problem both with this plugin and another star rating plugin that I’m using. It’s actually a built-in function of WordPress that when it makes a query to the database using $meta_key it automatically doesn’t show posts that don’t yet have that meta key assigned to them.

    The solution is to use filters to change how wordpress is grabbing info from the database. Unfortunetely, I dont’ know how to do this and have been searching around for the last couple days. If I find a useful link that helps me solve it, I’ll let you know, but I thought this might at least point you in the right direction.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem in sorting _count-views_all’ is closed to new replies.