wordpress: cant get category id when SEO URL is turned on
Posted
by
John K
on Stack Overflow
See other posts from Stack Overflow
or by John K
Published on 2012-07-06T09:04:37Z
Indexed on
2012/07/06
9:15 UTC
Read the original article
Hit count: 290
<?php
/*
Plugin Name: Members
*/
function myFilter2($query)
{
if ($query->is_category)
{
$currently_listing_categories = $query->query_vars['category__in'];
print_r($currently_listing_categories);
}
}
add_filter('pre_get_posts','myFilter2');
?>
This plugin display the category ids when the url is not SEO friendly
. but when I turn on SEO
the array is empty
how can I get the category id with SEO friendly urls
© Stack Overflow or respective owner