I am creating a directory and have a custom post type called "listings".

I want to display a grid of "Most viewed" listings as well as "Highest rated" listings on my homepage and throughout the website.

I am really not sure how to do this.


For most popular you can use something like https://github.com/williamsba/WordPress-Popular-Posts-with-Custom-Post-Type-Support/blob/master/wordpress-popular-posts.php

Actually there are several plugin and solutions it you check google, did you try it?

  • I was not aware of any plugins that can do this. Can you recommend any? Aug 15 '18 at 9:21
  • Check these github.com/williamsba/… , github.com/williamsba/… . I didn’t use any but that should work for you
    – Alex P
    Aug 15 '18 at 9:37
  • I installed the plugin but it is very unclear on how to add a custom post type. It seems they have updated the settings and you can no longer set the parameters. Is there any code I can change to make it only get the post type 'listing' ? Aug 15 '18 at 13:40

If using a plugin is a problem then try custom code, see solution here https://stackoverflow.com/a/30142214/2975536

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.