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

Meta key? #222

Closed chaser32419 closed 5 years ago

chaser32419 commented 5 years ago

I'm using elementor pro and crocoblock I found out they have a "Set custom query" option for posts. What is the meta_key for "Wordpress Popular Post" and does it change for each of the different instances is is used in ( example: day, week, month, year, all ), if not could you make that possible?

This is crocoblocks query generator to help make the custom queries. https://crocoblock.com/freemium/tools/wp-query-generator/

If you need I can setup a testing site with both of them for you to experiment with.

cabrerahector commented 5 years ago

Hi Chase,

No, WordPress Popular Posts doesn't insert any meta keys into your database (at the moment at least, this might change in the future) but fortunately this has been discussed before: How To: Sort a custom query by views (All time, monthly, weekly, or daily).

Please make sure to read the comments in there, there's a minor bug in OP's code that's easy to overlook if you don't read them.

chaser32419 commented 5 years ago

Thank you I appreciate the quick response. I got it working last night. Only way to see if it works perfectly is for time to pass.

Is there a user view, like it displays what posts the user has viewed recently?

cabrerahector commented 5 years ago

Glad to know you were able to sort it out.

Regarding your question, no, there's no such feature. For that I'd go with vanilla PHP and cookies and/or JS local storage.