WordPress.org

Forums

Twenty Twelve
[resolved] Header Image Help (59 posts)

  1. teakline
    Member
    Posted 1 year ago #

    Hi, I'm trying to add an image above my header so my site looks like:

    Header Image
    Blog Title
    Blog Post

    and was following a thread but I didn't realize I wasn't allowed to ask questions (seriously, I'm sorry) and was told to start my own thread.

    I asked my webhost to create a folder called "decode child" but now when I got to the themes on my site, it says the theme is broken and the stylesheet is missing, so I can't add the style.css file or folder.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    What would you want to create a child of the Decode theme when you are using the 2012 theme?

  3. teakline
    Member
    Posted 1 year ago #

    Wow, I'm just failing at everything today. I misunderstood. So if I create a child 2012 theme, then in theory will I be able to add the style.css folder?

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    You can call your child theme's folder anything that you want - even wibble or foobar but I'd suggest that you don't use any part of an existing theme that you have not installed as this might cause confusion later on if you do install that theme.

    Just create a folder called my-theme.

  5. teakline
    Member
    Posted 1 year ago #

    OK, I'm asking my webhost to create a new folder.

    I'm still confused why it says the decode theme is broken, though. (Just asking for when I have the new child folder installed, because I'm assuming the my folder theme will still be broken).

    I'm sorry I'm such an idiot.

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    I'm still confused why it says the decode theme is broken, though.

    The previous topic that you interrupted was about another theme called Decode. As you did not have that theme installed, all of the instructions in that topic were not relevant for you and you ended up referencing a parent theme you didn't have. This is one of the reasons we ask people to please post their own topics.

  7. teakline
    Member
    Posted 1 year ago #

    Well that makes sense, I'm sorry, I thought the themes were semi-universal and that if I added a child folder and followed the instructions, it would work. I also didn't realize I was supposed to post my own topic -- I thought I had a similar question and didn't want to post the exact same question, as I thought that would get me in trouble.

    Can we just start over? I feel really bad for interrupting, especially because I didn't realize I was doing it. I feel like a total asshole and now I feel like every question I ask is really stupid.

    Hi, I'm trying to add a header image above my blog title and don't know how. Can you please help me? I would really appreciate any feedback/help you can provide. Thanks!

  8. esmi
    Forum Moderator
    Posted 1 year ago #

    I thought the themes were semi-universal and that if I added a child folder and followed the instructions, it would work.

    Themes are highly individual and theme work is very, very, specific. Never be tempted to apply a fix from one theme into another unless you really do know what you are doing code-wise. If in doubt, always assume that you need theme-specific fixes etc.

    Since you're using 2012, you're in luck. I've already built some starter Twenty * child themes, so you can download a pre-made Twenty Twelve child theme from here. Upload it and activate it just like any other theme.

    I now have to log off for a few hours but I'll try to check in later to see how you got on with that.

  9. teakline
    Member
    Posted 1 year ago #

    Thank you so much for your help, I really appreciate it!

  10. Andrew
    Nuh uh moderator
    Posted 1 year ago #

    Nobody thinks bad of you, there's nothing to start over. This is just the Internet so there's not exactly normal etiquette that you'd find in real life (although we try).

  11. teakline
    Member
    Posted 1 year ago #

    I downloaded and installed the child theme you created (thank you!) but haven't activated it because I wasn't sure if I should do that yet. I'll wait to hear back from you. Thanks again.

  12. teakline
    Member
    Posted 1 year ago #

    @Andrew

    Thank you so much, I felt really horrible. I thought it was like Reddit in that anyone can comment.

  13. Andrew
    Nuh uh moderator
    Posted 1 year ago #

    Hi, I'm trying to add a header image above my blog title and don't know how. Can you please help me?

    So, did you manage to get your Child Theme set up properly?

  14. teakline
    Member
    Posted 1 year ago #

    Yes! I just haven't activated it yet because I wasn't sure if I was supposed to...

  15. Andrew
    Nuh uh moderator
    Posted 1 year ago #

    Yeah let's go ahead and activate that now

  16. teakline
    Member
    Posted 1 year ago #

    OK, it's activated :)

  17. teakline
    Member
    Posted 1 year ago #

    I'm not sure what to do next. Do I create a style.css file?

  18. esmi
    Forum Moderator
    Posted 1 year ago #

    The child theme already contains a style.css file. You wouldn't have been able to activate the child theme without it. :-)

    This header image that you want to add, would it be different for every post?. Or the same throughout the site?

  19. teakline
    Member
    Posted 1 year ago #

    Oh ok haha.

    The same throughout the site! I just want it to be above the blog title, when I tried to put in the header just through the parent twenty twelve, the photo was below the title and looked like it was part of the first blog post and I don't want that.

  20. esmi
    Forum Moderator
    Posted 1 year ago #

    Can we see your site for reference purposes?

  21. teakline
    Member
    Posted 1 year ago #

    I just refreshed my blog after activating the child plugin and the site looks weird no. The text is no longer formatted to stop at a certain width and the categories from the sidebar are gone...

  22. teakline
    Member
    Posted 1 year ago #

    Oh sorry just saw your above comment. It's alwaysoverthinkingit.com

  23. teakline
    Member
    Posted 1 year ago #

    Sorry, ignore my previous comment about the site looking weird.

  24. esmi
    Forum Moderator
    Posted 1 year ago #

    Can you temporarily deactivate your caching plugin or flush your cache? Right now, we can't see the child theme.

  25. esmi
    Forum Moderator
    Posted 1 year ago #

    Next, place a copy of the original 2012 header.php in your child theme. edit the child theme's copy of the file and move:

    <?php if ( get_header_image() ) : ?>
    		<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
    		<?php endif; ?>

    from just above </header><!-- #masthead --> to immediately below <header id="masthead" class="site-header" role="banner">.

  26. teakline
    Member
    Posted 1 year ago #

    I copied the section from the original 2012 with the section that says header, the code looks (partially) like this:

    /* Header */
    .site-header {
    padding: 24px 0;
    padding: 1.714285714rem 0;
    }

    I don't see any of the coding that you copied and pasted. Am I using the wrong original 2012 section?

  27. teakline
    Member
    Posted 1 year ago #

    Oh and I deactivated the cache plugin, so you should be able to see the site with the child theme.

  28. teakline
    Member
    Posted 1 year ago #

    I'm not sure where to get the header.php from.

  29. esmi
    Forum Moderator
    Posted 1 year ago #

    I'm not sure where to get the header.php from.

    From the parent 2012 theme. Just copy the whole file into your child theme.

  30. teakline
    Member
    Posted 1 year ago #

    OK just kidding I figured that part out! (I really should not be so proud of myself, but I'm terrified of coding).

    I've successfully moved the string of code to where you instructed.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic