carlodurso
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Thanks for the info.
Keep up your good work.
Hi Hector,
It works great, as expected. Thanks a lot.
The only issue I have found is that it doesn’t work when I’m logged in either as admin or normal user. It’s not an issue for me but I thought it could be valuable for you.
Finally, does it matter if I generate the $nonce outside functions.php? Right now I’m generating a custom tag in the footer thus I can copy it via jQuery.
Thanks again for your help.
Hector, I tested it again today and everything is working fine. I guess it was something wrong with Firefox, yesterday.
Cheers.
Forum: Hacks
In reply to: Adding sticky class to most viewed postsbcworkz you’re right on both, the foreach and the scheduled task. I’ll look into it. Thanks.
This is the working code for reference:
function promote_post($classes) { global $post; if (is_home() && wpp_get_views($post->ID) > 10){ stick_post(get_the_ID()); } else {unstick_post(get_the_ID()); } return $classes; } add_filter('post_class', 'promote_post');
Viewing 4 replies - 1 through 4 (of 4 total)