Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author Jan Koester

    (@dasmaeh)

    I think I got it now. Please try a last toime replacing query_recipes

    function query_recipes($query) {
    
    		// Don't change query on admin page
        	if (is_admin()){
        		return;
        	}
    
    		if ( ! is_admin() && $query->is_main_query() ) {
    
    			// Post archive page:
        		if ( is_post_type_archive( 'rpr_recipe' ) ) {
        			//set post type to only recipes
          			$query->set('post_type', 'rpr_recipe' );
    				return;
        		}
    
    			// All other pages:
    			if( !is_page() ){
    				// add post type to query
    				$post_type = $query->get('post_type');
                	if( is_array( $post_type ) && ! array_key_exists( 'rpr_recipe', $post_type ) ){
                		$post_type[] = 'rpr_recipe';
                	} else {
                		$post_type = array( 'post', $post_type, 'rpr_recipe' );
                	}
                	$query->set( 'post_type', $post_type );
    				return;
    			}
      		}
        }
    Thread Starter sunnydar

    (@sunnydar)

    Yep, that seems to be working! Thank you very much.

    Plugin Author Jan Koester

    (@dasmaeh)

    That’s great. I’ll release this fix tonight.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Version .7 Breaks my portfolio items’ is closed to new replies.