Tag Info

New answers tagged

3

The difference would be negligible. The the_content filter is fired regardless of whether you use it or not because WordPress uses it for other things. So the only thing that would be performance related would be the complexity of your filter function. But since you'd probably be doing the same level of complexity in a template or in the filter function, ...


2

A page template might be more efficient. If you decide to use the filter, you should return the value: function str_load_table($content) { if(is_page('my-table')) { $my_content = 'pretend this is a table'; $content .= $my_content } return $content; }


1

You can get rid of most of your code above. WP_User_Query has an include parameter (introduced in Wordpress 3.9) include (array) - List of users to be included. So we need to get a random array of author ID's. I have modified your count_users_with_posts() a bit here to extend it to make it more dynamic and to get a set amount of authors randomly. I ...


1

This is a rough draft of what I have so far. Please feel free to update it and improve it. First of all, we use the pre_user_action to choose the minimum number of posts a user needs to have in order to get their info and display it. It was taken from WP_User_Query to exclude users with no posts (by @helgatheviking). I just made some minor changes to fit my ...


0

The plugin User Bookmarks (discontinued now) by Pippin's Plugins did a combination: * store the "favorited" posts in user meta as serialized data * store the total favorite count in post meta as an integer This lets you sort by favorite count which is useful. You just have to change the count when people add/remove bookmarks. If you do go the "make your ...


0

I've actually made a plugin called Social Metrics Tracker which does exactly what you are trying to achieve. Please also feel free to read the source code on GitHub. To answer your questions: You are right that running an hourly cron task to update all of the posts would cause a problem with even just 200 articles because the server would make one GET ...



Top 50 recent answers are included