• Hi everybody,

    I’m using the Sela theme with a static front page. Is there a way to change the height of the front page image?

    Thanks and best wishes,
    Ninja

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Kathryn Presner

    (@zoonini)

    There isn’t a simple way to do this that I can see. The featured-image size for the homepage is set in the sela_setup() function in functions.php:

    // Hero Image on the front page template
    add_image_size( 'sela-hero-thumbnail', 1180, 610, true );

    The function can’t easily be overridden in a child theme because it’s not a “pluggable” function. To get around this, you’d need to set up a child theme, unhook the existing function, and then add a new setup function. Some more advanced PHP skills are needed in order to do that. Here are few Codex references that may help:

    https://codex.wordpress.org/Function_Reference/remove_action
    https://codex.wordpress.org/Function_Reference/add_action

    Why can’t I just edit the original functions.php?

    I edited it (increased the height to 840) and saved it:

    // Hero Image on the front page template
    add_image_size( ‘sela-hero-thumbnail’, 1180, 840, true );

    The new setting appears to be listed in the functions.php but the site is still not rendering at 840. Seems to me that I should be able to change the original file without a child and it should work but it didn’t.

    I followed those links and am not sure I understand how to use the remove action to solve this problem. could you give a code example, and where to place that code (in the functions.php, or using the Edit CSS function?)

    are the two variables I enter into the remove action ‘sela-hero-thumbnail’ and add_image_size?

    Also, the reason I am trying to modify this is because the text that I enter into the frontpage body overlays on this image, but then as you decrease the width of the browser window it runs “hidden” down off the image and you have to scroll within the body of the text to see all of it. without a scroll bar visible this is not intuitive for the user. this happens when viewing the site on an iPad.

    I noticed if I decrease the width of the window further the body text moves to below the image and is fully visible. This does this on my iPhone.

    I think I am realizing a possible solution would be to find out where the value is stored for the minimum screen width for overlaying and increase the minimum threshold to a value that allows all of the text to be read.

    Is there a way to do that?

    Moderator Kathryn Presner

    (@zoonini)

    Why can’t I just edit the original functions.php?

    Because if you edit the original theme files, you’ll lose your changes every time you update the theme to the latest version.

    The new setting appears to be listed in the functions.php but the site is still not rendering at 840. Seems to me that I should be able to change the original file without a child and it should work but it didn’t.

    When you modify a theme’s custom featured-image sizes (whether through a child theme or not) you need to run a plugin like Regenerate Thumbnails to regenerate the images at the new sizes.

    Moderator Kathryn Presner

    (@zoonini)

    I noticed if I decrease the width of the window further the body text moves to below the image and is fully visible. This does this on my iPhone.

    Yes, this is the theme’s responsive design.

    Also, the reason I am trying to modify this is because the text that I enter into the frontpage body overlays on this image, but then as you decrease the width of the browser window it runs “hidden” down off the image and you have to scroll within the body of the text to see all of it. without a scroll bar visible this is not intuitive for the user. this happens when viewing the site on an iPad.

    The front-page text box is not designed for a very large amount of text, so perhaps this the issue in your case. It’s designed for a fairly short piece of text.

    I just noticed that this thread is over 7 months old – would you mind starting a new one and provide a link to your site when you do so I can take a look directly? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change height of featured image on front page’ is closed to new replies.