Tag Info

Hot answers tagged

2

The third parameter for add_filter is the priority in which the filter is executed, the forth is the number of parameters the function in the second parameter uses. The wpcodex_filter_main_search_post_limits function has an if that checks uses a couple of wordpress function to establish where in your page you are executing the code, in this case it's ...


2

First of all, never use query_posts. Rather use WP_Query to construct your custom query which is the prefered way You are also using the category_name parameter wrong. If you look at the WP_Query documentation, it states category_name (string) - use category slug (NOT name). Go and have a look at the examples given in the docomentation under the ...


1

Your use of queries is completely wrong, and as stated before, query_posts should never be used. The method you are using to retrieve you category ID's are also a waste of resources. It would save much more if you knew the ID's. I would also look at get_categories to retrieve my category details and passing that to my custom query. METHOD 1 If these ...



Only top voted, non community-wiki answers of a minimum length are eligible