• Hi, I just downloaded your plugin. It’s great. Really seems to work very well and it’s very simply and easy to set up.

    Questions:

    1. Would it be too hard to set a width to the image display? Say you don’t want it to go edge to edge.

    2. What about displaying a smaller version of the featured image. Say for example, my featured image largest size is 1140px, but I want to display my medium image size of 750px, centered.

Viewing 1 replies (of 1 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    You have some options here. For the first, if you want to keep the backstretch effect, but constrain it, you can tinker with CSS, or change the hook that the plugin uses for the image output (see the FAQ).

    You could also just force the plugin to use the large image, instead of the backstretch image, with this filter:

    add_filter( 'display_featured_image_genesis_use_large_image', 'prefix_use_large' );
    /**
     * Force the plugin to always use the large image size, sitewide.
     * @return array
     */
    function prefix_use_large() {
    	return get_post_types();
    }

    More examples are in the FAQ.

    For the second question, the plugin works very hard to not display small images, so the medium image setting (default 300px) is its baseline. You can modify that and use your medium image with these two filters:

    add_filter( 'displayfeaturedimagegenesis_set_medium_width', 'prefix_change_minimum_width' );
    /**
     * Change the minimum width that the plugin considers acceptable for the featured image.
     * Default is the medium image setting.
     * @return int
     */
    function prefix_change_minimum_width() {
    	return 749; // assuming 750 is your medium image, but just set this to be lower than what you want
    }
    
    add_filter( 'displayfeaturedimagegenesis_image_size', 'prefix_use_medium' );
    /**
     * Force the plugin to use a certain image size.
     * @return string
     */
    function prefix_use_medium() {
    	return 'medium'; // instead of backstretch/large
    }

    Hope that helps you get started–

Viewing 1 replies (of 1 total)
  • The topic ‘Setting Image Width’ is closed to new replies.