Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Bernhard Riedl

    (@neoxx)

    Hi whiteorb,

    Hmm, I’ve never heard of such an issue before. – Maybe there’s a conflict with another plugin or your theme.

    To test please deactivate all plugins and reload your test-page with only TagPages activated. If it worked, try to activate one plugin after another and reload the page each time.

    If it didn’t work, try to setup one of the default themes (TwentyTen or TwentyEleven).

    Greetz,
    Berny

    Thread Starter whiteorb

    (@whiteorb)

    It doesn’t occur with the default themes. Can you think of anything that could possibly cause this?

    Thread Starter whiteorb

    (@whiteorb)

    It doesn’t occur with the default themes. Can you think of anything that could possibly cause this?

    Thread Starter whiteorb

    (@whiteorb)

    So it was caused by this function

    add_filter('pre_get_posts', 'query_post_type');
    function query_post_type($query) {
      if(is_category() || is_tag()) {
        $post_type = get_query_var('post_type');
    	if($post_type)
    	    $post_type = $post_type;
    	else
    	    $post_type = array('post', 'software', 'documents', 'news', 'nav_menu_item', 'page');
        $query->set('post_type',$post_type);
    	return $query;
        }
    }

    Fortunately, I don’t need it any longer. Curious though why that would happen.

    Plugin Author Bernhard Riedl

    (@neoxx)

    Cool. – You found the issue. ?? I’m also curious, so here’s an idea:

    As I also use a pre_get_posts-filter to manipulate the post_type in $wp_query, it looks to me like a race condition between the two filters.

    Your code sets the post_type to array('post', 'software', 'documents', 'news', 'nav_menu_item', 'page'); if the post_type has not been set before.

    TagPages sets the post_type to array('post', 'page') if the post_type has not been set before.

    So, if the TagPages-filter is executed before your filter, it will never reach your else-fork.

    The default $priority = 10 for all filters, so I think setting your function to a higher priority (e.g. to 9) would achieve the desired functionality.

    Thread Starter whiteorb

    (@whiteorb)

    Ah ok, so I set the priority before the function and that seemed to resolve another issue that had come up. Very cool!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: TagPages] PageTags cause tag results to lose menu’ is closed to new replies.