User Following System

Here are some pointers: Why are you using output buffering in tb_get_follow_unfollow_links()? I see no reason this is needed. In tb_get_follow_unfollow_links() only echo 1 button. On page load use php to decide what classes and button text you have to set. With jQuery change the button when you get a successfull ajax return. Change the … Read more

How to get value of a selected option from select tag and use it in WP_query to filter posts?

I assume you have posts with custom fields that have your select fields values as values for these custom fields, in this case you should take a closer look in ‘Custom Fields Paramenters’ from the WP_Query class references at: https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters doing so you can just compare you select fields values with your post custom fields … Read more

Single query for multiple categories

If you’re running a website that has a high traffic, querying posts on each load will not be efficient. You should instead cache the data. Now, I’m not talking about a plugin that caches the pages, I’m talking about caching your query. You can run 10 queries and fetch 10 post IDs from each category, … Read more