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

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

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

php - Get uncommon values from two or more arrays -