Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm writing a child theme for Genesis and trying to figure out to get the full image sizes on "Genesis - Featured Posts" widget. The widget has a check box "Show Featured Image" and "Image Size" options of following values.

thumbnail (150x150) 
featured-image(150x100)

The options have thumbnail sizes and I'm trying to get the full size of image. Trying to write some code in functions.php of child theme which would give an option to select "full featured image".

The codes which listed second option for "Show Featured Image" on the widget is (genesis/lib/widgets/featured-post-widget.php line: 314 - 318)

<?php
$sizes = genesis_get_additional_image_sizes();
    foreach( (array) $sizes as $name => $size )
        echo '<option value="'.esc_attr( $name ).'" '.selected( $name, $instance['image_size'], FALSE ).'>'.esc_html( $name ).' ( '.$size['width'].'x'.$size['height'].' )</option>';
?>

I'm not sure if there is a way to have hook or filter for this .. If there is a way to select 'full featured image size' on the widget I'd be great.

share|improve this question
add comment

2 Answers

If you replace genesis_get_additional_image_sizes(); with genesis_get_image_sizes() you can choose any size image for the widget thumbnail.

Replacement featured-post-widget.php is available on GitHub. And here is the replacement code:

$sizes = genesis_get_image_sizes();
                    foreach( (array) $sizes as $name => $size )
                        echo '<option value="'.esc_attr( $name ).'" '.selected( $name, $instance['image_size'], FALSE ).'>'.esc_html( $name ).' ( '.$size['width'].'x'.$size['height'].' )</option>';
share|improve this answer
add comment
up vote 0 down vote accepted

A simple function which would add additional image size.

/*
 * add_image_size( 'post-thumbnail', $width, $height, $crop );
 * 280x254
 */

add_image_size( 'additional-image-size', 800, 600, false );

This function will add additional image size of width 800px and height 600px this function can be used in child-theme's functions.php

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.