Forum Replies Created

Viewing 15 replies - 181 through 195 (of 262 total)
  • Plugin Author Jan Koester

    (@dasmaeh)

    Frontend submission is currently not supported and there are no plans to change this.

    Plugin Author Jan Koester

    (@dasmaeh)

    Alright, now I understood the problem. Below you can find the function query_recipes() that solves this issue. It will be in the next release.

    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() && ! is_attachment() ){
    				// 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;
    			}
      		}
        }
    Plugin Author Jan Koester

    (@dasmaeh)

    Still can’t reproduce the error you seem to get. Embedding images in recipes and posts works perfectly for me. Also linking those to the original file for a lightbox works.

    Plugin Author Jan Koester

    (@dasmaeh)

    Actually rpr_default should be set as default AND the code in line 602 should replace the option by ‘rpr_default’ in case the option string ist empty.

    As I’m currently reworking the whole settings section I will take specila care of this. Thanks for reporting this issue.

    Plugin Author Jan Koester

    (@dasmaeh)

    I’m sorry I can’t reproduce this faulty behaviour on my testing system. Please provide some more information on your setup, permalink structure and versions.

    Plugin Author Jan Koester

    (@dasmaeh)

    Please try inserting the following code in rpr_core.php line 200

    // Querying specific page (not set as home/posts page) or attachment
    			if(!$query->is_home()) {
                   if($query->get('page_id') !== 0 || $query->get('pagename') !== '' || $query->get('attachment_id') !== 0) {
                        return;
                    }
                }
    Plugin Author Jan Koester

    (@dasmaeh)

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

    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;
    			}
      		}
        }
    Plugin Author Jan Koester

    (@dasmaeh)

    Already got it. That’s why you should replace the function once again.

    Plugin Author Jan Koester

    (@dasmaeh)

    Sure.
    Just to explain it:

    The function query_recipes manipulates the wp_query to add recipes as post_type to the query so recipes can be displayed in category listings, on the front page, etc.
    However this manipulation seems to throw out the portfolio post type. This shouldn’t happen though. I’ll now try to figure out how to avoid this. Therefore I will need the output of the two var_dump statements.

    Plugin Author Jan Koester

    (@dasmaeh)

    Forgot to mention: Please remove the comment in line 39 again. Thanks.

    Plugin Author Jan Koester

    (@dasmaeh)

    Thanks for giving me access. However I still cannot clearly see the reason for the problem. And I cannot edit file which is probably causing all the problems from the backend.

    Could you please to 2 things for me:

    1. Comment line 39
      //add_action( 'pre_get_posts', array( $this, 'query_recipes' ) );

      in rpr_core.php, activate the plugin and see id the portfolio items are working. Recipes shouldn’t work then.

    2. Once again replace the function query_recipes by the following. I need to see how the query is changed.
      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() ){
      				var_dump($query);
      				// 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', 'rpr_recipe' );
                  	}
                  	$query->set( 'post_type', $post_type );
      				var_dump($query);
      				return;
      			}
        		}
          }

    Thanks for your help!

    Plugin Author Jan Koester

    (@dasmaeh)

    There still was a nasty bug in the patch I posted above. If the following code helps, all is well.

    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', 'rpr_recipe' );
                	}
                	$query->set( 'post_type', $post_type );
    				return;
    			}
      		}

    If not access to your dev system could indeed be helpful. Please send me a private mail to jan.koester@cbjck.de

    Plugin Author Jan Koester

    (@dasmaeh)

    As far as RecipePress reloaded is concerned there was another bug in the code I sent you preventing all pages from loading. Could you please replace the function query_recipes once more, this time by:

    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', 'rpr_recipe' );
                	}
                	$query->set( 'post_type', $post_type );
    				return;
    			}
      		}

    On my development system this is now working as I expect it to work. If it works for you too I’ll release it as v0.7.1

    Thanks for your patience and effort!

    Plugin Author Jan Koester

    (@dasmaeh)

    Please provide some more information on the type of pages not working. How did you create them, do they work with recipepress reloaded disabled?

Viewing 15 replies - 181 through 195 (of 262 total)