Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi Megan!

    Can you give me a few more details about what you mean by stretching the image over the entire length of the page? Do you mean that you want it to be a full background image, like this: https://css-tricks.com/wp-content/csstricks-uploads/fullpagebackground.jpg

    Thread Starter mrmccarrin

    (@mrmccarrin)

    Hi!

    I would like the height of my image to stay the same and I would like to expand the width.

    My image is currently the width of my site and I can’t figure out how to go past it so it goes the width of the whole page.

    Does that make sense?
    Thanks again!

    Hey, it looks like you got it! Hi-5!

    Thread Starter mrmccarrin

    (@mrmccarrin)

    Oh no I did not. I mean that I want it to go the entire width of the page. Like the menu bar. I have searched for an answer and nothing is working. Any suggestions?

    oh duh, sorry – i looked at it on my tablet and it worked! but i see it doesn’t in desktop.

    so, this is an HTML/CSS issue. on desktop, you have a wrapper div around your content called #page, and it has a fixed width of 980. That’s keeping it from taking up the full width of the page. Here’s a screencap: https://imgur.com/pAsgida

    You could solve this by making a child theme and closing the #page div before the #banner div, setting the background-size of #banner to cover, and reopening the #page div for the content below, but that will likely effect the mobile view, so be sure to check both.

    When I have a problem like this, I normally build out the HTML/CSS totally separate from WP, just in text editor, and make sure it works the way I want, then add it in! This prevents unanticipated kerploding. ??

    Thread Starter mrmccarrin

    (@mrmccarrin)

    Thank you. I understand now. However, I went to go and try and make a child theme. However, I made my theme from scratch. So, it tells me I need to install the parent theme. Is this a normal problem when creating your own theme?

    Thread Starter mrmccarrin

    (@mrmccarrin)

    Never mind. I got around it by adding a CSS editor and added background-size: cover;. My next question is, how do I close the page div before the banner div? I do not see that in my front page template? Could you please explain?

    Thank you very much!

    You bet! Most likely, you can just add a closing </div> tag right before the banner. you’re basically try to do this:

    <div id ="page"><!--this has a fixed width of 980px-->
    <div id= header'></div>
    </div><!--this closes your page div-->
    <!--this ends the first block. now add in your banner-->
    <div id="banner"></div>
    <!---this ends your banner. now add in your content, being sure to wrap it in a fixed width or the layout will break-->
    <div id="lowerpage"><!--this should also have a fixed width of 980 px-->
    <div id="content"></div>
    </div>

    Also, if you decide to try doing a child theme, there are really good details on how to do it in the Codex: https://codex.www.ads-software.com/Child_Themes#How_to_Create_a_Child_Theme

    Thread Starter mrmccarrin

    (@mrmccarrin)

    Perfect thank you so much for your help.

    And, thanks for the instructions. I did follow them, but I think I made a mistake in my parent theme. I get a “your parent theme is not registered error.” ugh! I will figure it out at some point ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Stretch Image length of page’ is closed to new replies.