casperknight
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to disable popads on my wordpress?@gappiah They are important videos.
Forum: Plugins
In reply to: [WP Popular Posts] How to query WPP with Elementor?Again, I apologize for the very late reply as I rarely even login in ww.wp.xz.cn
I did what exactly @robhills1985 said. There’s nothing more I can really add, he explained the steps accurately.
Cheers everyone!
Forum: Plugins
In reply to: [WP Popular Posts] How to query WPP with Elementor?@zydarek , yes I did solve it.
I didn’t put the code in my functions.php I like to keep everything organized and clean so I installed a plugin called “Snippets” created a new snippet, then added the code there. Been working fine.
Sorry for the late reply.
Hi Hector, how are you? hope you are fine man 😀
- This reply was modified 5 years ago by casperknight.
Forum: Plugins
In reply to: [WP Popular Posts] How to query WPP with Elementor?Hi Hector,
I apologize for wasting your time because of my stupidity lmao
update_post_meta(
$postid,
‘views_daily’,
wpp_get_views($postid, ‘daily’, false)
);I deleted the above code after testing it for the first time because I wanted to check if it really showing the daily posts or the code was corrupt then I forgot to paste it back.
I pasted it back and everything is now working. Again, I’m sorry for this.
Thanks for helping me, I was looking for this for days. I wish you the best of luck in your work and thanks for this amazing plugin.
I will wait for a few hours if you want to say anything before I mark it as solved.
Stay safe and have a nice day : )
Forum: Plugins
In reply to: [WP Popular Posts] How to query WPP with Elementor?Yes. I edited it to 100 and even cleared my cache. Weird problem.
Sorry for taking so much time from you, I can mark the problem as solved if you want me and try to find a solution myself, somehow. You did the hard part, don’t want to bore you more than this.
EDIT: Saw your update after I commented this
- This reply was modified 5 years, 1 month ago by casperknight.
Forum: Plugins
In reply to: [WP Popular Posts] How to query WPP with Elementor?I edited it and still shows only 2 posts.
Forum: Plugins
In reply to: [WP Popular Posts] How to query WPP with Elementor?https://i.imgur.com/o2MVeKj.jpg
Check the photo above. The output should be the same number of posts in the “24h” tab in the stats page right?
Well, there are 9 posts in this tab but it only shows 2 posts on the website 🙁
Forum: Plugins
In reply to: [WP Popular Posts] How to query WPP with Elementor?Hi Hector, thanks for your time trying to help me. You have no idea how long I have been searching for this to pull it off.
Here’s what I did. I put this whole code:
/** * Stores views of different time periods as meta keys. * * @author @migueleste / @radgh * @link https://ww.wp.xz.cn/support/topic/how-to-sort-a-custom-query-by-views-all-time-monthly-weekly-or-daily/ * @param int $postid The ID of the current post/page/custom post type. */ function custom_wpp_update_postviews($postid) { // Accuracy: // 10 = 1 in 10 visits will update view count. (Recommended for high traffic sites.) // 30 = 30% of visits. (Medium traffic websites.) // 100 = Every visit. Creates many db write operations every request. $accuracy = 50; if ( function_exists('wpp_get_views') && (mt_rand(0,100) < $accuracy) ) { // Remove or comment out lines that you won't be using!! update_post_meta( $postid, 'views_total', wpp_get_views($postid, 'all', false) ); update_post_meta( $postid, 'views_daily', wpp_get_views($postid, 'daily', false) ); update_post_meta( $postid, 'views_weekly', wpp_get_views($postid, 'weekly', false) ); update_post_meta( $postid, 'views_monthly', wpp_get_views($postid, 'monthly', false) ); } } add_action('wpp_post_update_views', 'custom_wpp_update_postviews'); add_action('elementor/query/popular_posts', function($query) { $query->set('orderby', 'meta_value_num'); $query->set('meta_key', 'views_daily'); });in functions.php and query it in Elementor’s query id “popular_posts”
The posts actually showed up, but because I have noob skills in code, I don’t know if what I did is actually right or wrong?
I didn’t change the $accuracy too.
To be clear with you, I want to show the most popular posts in the last 24 hours/daily views. Is this THE code for this job?
Also what’s the parameter for “trending now”?
Cheers
- This reply was modified 5 years, 1 month ago by casperknight.
- This reply was modified 5 years, 1 month ago by casperknight.
Forum: Fixing WordPress
In reply to: How to just change the posts content font size?Sahifa – A premium wordpress theme.
Forum: Fixing WordPress
In reply to: No spaces between the paragraph !Problem isn’t solved 🙁
Forum: Fixing WordPress
In reply to: How to add a Copyrights in my footer?I use a localhost so i can’t give u my website link,
can u give me an HTML for Copyright?
Forum: Themes and Templates
In reply to: How to Remove Posted by Admin From Posts?@alchymyth
Commercial? I downloaded it from website ( Translated Theme )
and i can activate it into wordpress.
so how it could be commercial?..
@esmi
From here: [ Link redacted, we do NOT post commercial themes on this forum ]: )
Forum: Themes and Templates
In reply to: How to Remove Posted by Admin From Posts?How can i activate it? / i’m using localhost.
Forum: Themes and Templates
In reply to: How to Remove Posted by Admin From Posts?How can i create one?
I download child them( function.php & style.css) so what now?: )
[No bumping. If it’s that urgent, consider hiring someone.]
Forum: Themes and Templates
In reply to: How to Remove Posted by Admin From Posts?Explain Please.