Viewing 4 replies - 1 through 4 (of 4 total)
  • Same problem for me.
    The tags cloud is still the same than before but the search process looks into the events and not anymore in the posts.

    When i click on a tag now i have the 404 error

    Thx,

    Thread Starter samuelstraka

    (@samuelstraka)

    Mout, I found some solution before fixing this bug in next version of the plugin.
    You must to add to functions.php this code:

    <?php
    
    add_action( 'parse_query', 'tribe_fix_tag_query' );
    function tribe_fix_tag_query( $query ) {
    	if ( $query->is_tag && (array) $query->get( 'post_type' ) != array( TribeEvents::POSTTYPE ) ) {
    		if ( empty( $query->query_vars['post_type'] ) ) {
    			$query->query_vars['post_type'] = array( 'post' );
    		}
    		if ( ! ( $query->query_vars['post_type'] == array( 'post' ) || $query->query_vars == 'post' ) ) {
    			remove_action( 'parse_query', array( 'TribeEventsQuery', 'parse_query' ), 50 );
    			remove_action( 'pre_get_posts', array( 'TribeEventsQuery', 'pre_get_posts' ), 50 );
    		}
    	}
    }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Thx it’s work perfectly!

    Glad you guys are sorted – thanks for helping out there samuelstraka ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wrong search tags’ is closed to new replies.