cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
280 stars 83 forks source link

Option or snipped to save total number of views to post/page/cpt meta field #211

Closed holzhannes closed 5 years ago

holzhannes commented 5 years ago

I would be great to have the possibility to save the value of visits to a meta value of each post, page or custom post type. It could be done with a cron job every day. Therefore this value could be used for sorting content with custom Queries or with Plugins like Display Posts Shortcode.

cabrerahector commented 5 years ago

Hi @holzhannes,

Option or snipped

There's no built-in option for this (yet, and there might or not be one in the future) but there's a code snippet another user posted at the support forums that does exactly this:

How To: Sort a custom query by views (All time, monthly, weekly, or daily)

Please pay special attention to some of the comments posted there.