Support » Plugin: Feature A Page Widget » Feature Request: Set max-width and max-height

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mark Root-Wiley


    Check out this thread and see if that solution works for your. Note the difference between the image size and the CSS layout size mentioned in the last post.

    Yes, to make it 300px x 300px, the following code works. Thanks.

    // create custom image size, 80x80 with hard crop
    add_image_size( 'fpw_custom_thumbnail', 300, 300, true);
    // override the featured image with custom size image
    function fpw_custom_featured_image( $featured_image, $featured_page_id ) {
        return get_the_post_thumbnail( $featured_page_id, 'fpw_custom_thumbnail' );
    add_filter( 'fpw_featured_image', 'fpw_custom_featured_image', 10, 2 );

    Adding the style rule seemed not necessary when the image is set to a larger scale by the way.

    Also changing the values in the following line in feature-a-page-widget.php worked. But this edits the plugin code so it’s not recommended since it will be gone after an plugin update.
    add_image_size( 'fpw_square', 200, 200, true );

    Currently setting a custom width and height requires a little bit complicated coding for end users so maybe it’s an good option to consider implemented as an option.

    Plugin Author Mark Root-Wiley


    Because the image-width is a percentage, whether the image is large-enough to occupy the full space (or is shrunk down) will change from site-to-site. I’ll try to think through how I can let people control the images better in future versions. Thanks for the feedback!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Feature Request: Set max-width and max-height’ is closed to new replies.