php - Wordpress - category__in is not listing on $wp_query with SEO urls -


i have simple plugin:

add_action('pre_get_posts', 'post_page'); function post_page() { global $wp_query; if(is_category()) { echo '<pre>'; print_r($wp_query); exit; } } 

i have category ids within plugin. getting without seo urls category__in empty seo urls

without seo friendly url (category__in not empty) :

http://phpxpert.com/?cat=3

with seo friendly url (category__in empty):

http://phpxpert.com/category/jquery/

why happening , how can post_id , category_ids in plugin?

thank

you'll find category being used in category_name variable. can use get_term_by more information category.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -