Viewing 9 replies - 1 through 9 (of 9 total)
  • 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;
                    }
                }
    Thread Starter sunnydar

    (@sunnydar)

    That didn’t fix it.

    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.

    Thread Starter sunnydar

    (@sunnydar)

    permalinks structure: https://thestandardblog.com/2014/10/sample-post/
    wordpress version: 4.0
    RP: Version 0.7.2

    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.

    Thread Starter sunnydar

    (@sunnydar)

    Embedding images works fine. The lightboxes work fine. It’s just went I go to the attachment permalink page, I get a 404. All of the images are still showing up fine though.

    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;
    			}
      		}
        }
    Thread Starter sunnydar

    (@sunnydar)

    thank you.
    What file is the function query_recipes($query) in?

    Thread Starter sunnydar

    (@sunnydar)

    Found it. That fixed it. Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘404 image permalinks’ is closed to new replies.