• I was having a problem with this widget and the subsidiary widgets in my theme. The theme author found a bug in the plugin. Basically, it’s outputting an image instead of returning it for later use.

    This:

    // If no post thumbnail found, check if Get The Image plugin exist and display the image.
    elseif ( function_exists( 'get_the_image' ) ) :
    	$html .= get_the_image( array(
    		'height'        => (int) $args['thumb_height'],
    		'width'         => (int) $args['thumb_width'],
    		'image_class'   => esc_attr( $args['thumb_align'] ) . ' rpwe-thumb get-the-image',
    		'image_scan'    => true,
    		'default_image' => esc_url( $args['thumb_default'] )
    ) );

    Should be this:

    // If no post thumbnail found, check if Get The Image plugin exist and display the image.
    elseif ( function_exists( 'get_the_image' ) ) :
    	$html .= get_the_image( array(
    		'height'        => (int) $args['thumb_height'],
    		'width'         => (int) $args['thumb_width'],
    		'image_class'   => esc_attr( $args['thumb_align'] ) . ' rpwe-thumb get-the-image',
    		'image_scan'    => true,
    		'default_image' => esc_url( $args['thumb_default'] ),
    		'echo' => false
    ) );

    The widget is outputting an image *outside* of the widget container. This means that the theme loses a lot of control because it expects widget containers to contain the entirety of the widget. That way, things can be appropriately positioned.

    https://www.ads-software.com/plugins/recent-posts-widget-extended/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am having the exact same issue on one of my sites. I was about to post a new thread about it, but you beat me too it.

    The Get the Image plugin echoes the image by default in the get_the_image() function. Adding 'echo' => false to the options array passed to it fixes things.

    I’m hoping the plugin author sees this fairly soon and addresses things with a bug fix. I don’t remember if I used this plugin on another site or not.

    Thread Starter TheRiz

    (@theriz)

    Any update here?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug Code Fix Here’ is closed to new replies.