WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my theme, I registered a taxonomy by the name of tax_groups for a custom post type named custom_items. So the following URL was returning the lastest custom_items http://website.com/custom_items/

The Search widget was also working perfectly fine but not Tag and Taxonomy links like these:

share|improve this question
up vote 0 down vote accepted

I had to modify queries before they run. So the best practice was to add the following code to function.php:

if (!function_exists('my_theme_filter')) {
    function my_theme_filter( $query ){

    if ( $query->is_main_query() )
        if ( $query->get( 'tag' ) OR is_search() )
            $query->set( 'post_type', array( 'artprim_item' ) );

    //echo '<pre>'; print_r($query); echo '</pre>';

    return $query;
add_filter( 'pre_get_posts', 'my_theme_filter' );
share|improve this answer
I wanted to mention that the method described in [this question] (wordpress.stackexchange.com/questions/28145/…) solved the problem for me. – JPollock Jan 8 '13 at 6:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.