• MaruscaGabriel

    (@maruscagabriel)


    Hi,
    Is the firs time I try this plugin within a theme that I develop using Genesis Framework. Here is the test site.
    I install the plugin, activate it, regenerate the thumbnails, but nothing happened. No srcset attribute, no responsive image. Can you help? Thanks.
    I even add a new post to the current ones, but still nothing.
    I use the current image formats in my functions.php

    update_option( 'thumbnail_size_w', 215, true );
        update_option( 'thumbnail_size_h', 135, true );
        update_option( 'medium_size_w', 300, true ); //mobile single
        update_option( 'medium_size_h', '', true );
        update_option( 'large_size_w', 800, true ); //desktop single
        update_option( 'large_size_h', '', true );
        add_image_size('grid-thumbnail', 215, 135, true); //loop thumbnail
            add_image_size('mobile-thumbnail', 300, 188, true); //loop thumbnail mobile
            add_image_size('sidebar-thumbnail', 336, 194, true); //single sidebar

    I use a custom grid loop and I call the grid-thumbnail in it. Is that the reason?

    'grid_image_size' => 'grid-thumbnail',

    Thank you in advance,
    Gabriel

    https://wordpress.org/plugins/ricg-responsive-images/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Joe McGill

    (@joemcgill)

    Hi Gabriel,

    It looks like the image size you’re calling is a hard cropped size and it may be that WordPress isn’t finding any other images that match that aspect ratio. If you had another image size, say: add_image_size( 'grid-thumbnail-2x', 430, 270, true);, I would expect that image to show up in the srcset when you call for the “grid-thumbnail” size.

    Joe

    Thread Starter MaruscaGabriel

    (@maruscagabriel)

    Hi Joe,

    Thank you for your answer. Unfortunately doesn’t work. I create the type of images you suggest:

    add_image_size('grid-thumbnail', 215, 135, true); //loop thumbnail
    	add_image_size('mobile-thumbnail', 300, 188, true); //loop thumbnail mobile
    	add_image_size('sidebar-thumbnail', 336, 194, true); //single sidebar
    	add_image_size('grid-thumbnail-x2', 430, 270, true); //loop thumbnail
    	add_image_size('mobile-thumbnail-x2', 600, 376, true); //loop thumbnail mobile
    	add_image_size('sidebar-thumbnail-x2', 672, 388, true); //single sidebar

    After that, I regenerate the images, but nothing change.
    Still no srcset attribute and no responsive image in the grid. I still got the 215×135 image.

    Regards,
    Gabriel

    Plugin Contributor Joe McGill

    (@joemcgill)

    Hi Gabriel,

    It seems like there may be something in the theme that is conflicting with the plugin. I’m not sure if it’s something with the Genesis framework (which I’m not super familiar with) or something specific to your implementation. If you could share the template code that is used to display the images, I may be able to see what’s happening.

    Joe

    Thread Starter MaruscaGabriel

    (@maruscagabriel)

    Hi Joe,

    Thanks again.

    Here is my code from the functions.php that display the loop

    <?php
    // Update Image Sizes
    	update_option( 'thumbnail_size_w', 215, true );
    	update_option( 'thumbnail_size_h', 135, true );
    	update_option( 'medium_size_w', 300, true ); //mobile single
    	update_option( 'medium_size_h', '', true );
    	update_option( 'large_size_w', 800, true ); //desktop single
    	update_option( 'large_size_h', '', true );
    
    	add_image_size('grid-thumbnail', 215, 135, true); //loop thumbnail
    	add_image_size('mobile-thumbnail', 300, 188, true); //loop thumbnail mobile
    	add_image_size('sidebar-thumbnail', 336, 194, true); //single sidebar
    	add_image_size('grid-thumbnail-x2', 430, 270, true); //loop thumbnail
    	add_image_size('mobile-thumbnail-x2', 600, 376, true); //loop thumbnail mobile
    	add_image_size('sidebar-thumbnail-x2', 672, 388, true); //single sidebar
    
    	//* Add support for Genesis Grid Loop
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'child_grid_loop' );
    
    function child_grid_loop() {
    
    	//* Global vars
    	global $_genesis_loop_args;
    
    	//* Parse args
    	$args = apply_filters(
    		'genesis_grid_loop_args',
    		wp_parse_args(
    			$args,
    			array(
    
    				'grid_image_size'		=> 'grid-thumbnail',
    				'grid_image_class'		=> 'alignleft',
    				'grid_content_limit'	=> 0,
    				'more'					=> '',
    			)
    		)
    	);
    
    	//* What page are we on?
    	$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
    
    	//* Set global loop args
    	$_genesis_loop_args = $args;
    
    //hooks and filters for 
    
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
    remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );
    remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
    remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
    remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    	//* The loop
    	genesis_standard_loop();
    
    	//* Reset loops
    	//genesis_reset_loops();
    	remove_filter( 'post_class', 'genesis_grid_loop_post_class' );
    	remove_action( 'genesis_post_content', 'genesis_grid_loop_content' );
    	remove_action( 'genesis_entry_content', 'genesis_grid_loop_content' );
    }

    Thanks,
    Gabriel

    Tnace

    (@radiocure1)

    I’m also having the same issue with my Genesis Framework theme. It’s not showing any responsive images.

    I posted this in GenesisWP on Slack, and here’s the response I got:

    I think that’s the plugin some of us discussed at WordCamp London. We discussed whether it was likely to be compatible with genesis_get_image, and I said that it probably is because genesis_get_image calls wp_get_attachment_image. But I later looked at the plugin source and it doesn’t support images that come from wp_get_attachment_image, only ones that come from get_the_post_thumbnail or hard-coded into the post body. I don’t know why.

    Wow, thanks for that ElectricBrick,

    It would be awesome if someone much more cleaver than I am to come up with a Genesis Compatible Version of this plugin.

    Wouldn’t it simply be replacing all of the occurrences of get_the_post_thumbnail with get_the_post_thumbnail?

    I Sure would like to have this capability under the hood of my Genesis Sites

    Plugin Author tevko

    (@tevko)

    Hi all, relevant Github issue created here – https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images/issues/91

    Please feel free to contribute!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Incompatibility with Genesis Framework?’ is closed to new replies.