• I started working with a child theme yesterday, and I have had so many problems. Right now, I’m just trying to get something workable, but when I attempt to replace my title text with an image in the header.php I created, the entire blog reverts to standard html (Times New Roman, blue links, etc.) and the theme is totally gone. The sidebar disappears, etc. Here:

    The Stylist Quo

    It appears that this happens any time I alter something in the header page.

    In addition, I received this error message:

    Warning: Cannot modify header information – headers already sent by (output started at /home/clhurley/webapps/wp/wp-content/themes/2012child/functions.php:1) in /home/clhurley/webapps/wp/wp-includes/pluggable.php on line 881

    around which I can work, somewhat, but I feel like this is not good? And it makes changing basic functions quite difficult. Please help! I am so close to literally banging my head against the wall. It would feel better than this.

    Edit: Actually, the “cannot modify header information” pops up when I attempt to preview a draft, also, making it pretty difficult to write new content for the rest of this week. Ahhhhhh!

Viewing 13 replies - 1 through 13 (of 13 total)
  • There is no header at all….

    It’s a bit hard to assess what’s going on, as I don’t know what you have in your shild theme, or how you created it

    But your site looks all jacked because nothign is coming from header.php to call to your stylesheet. Perhaps you can describe your child theme a bit? What is in there? what files, did you make them from scratch, etc?

    I have a post, https://vudu.me/child which gives real basic details about child themes…. if it helps

    Thread Starter thestylistquo

    (@thestylistquo)

    I had a bit of stuff in the header, mainly plopping an image at the top to link to my shop and then right below it an image for the title, rather than text, as well as Google Fonts code. Honestly, I forget why I deleted it, or attempted to, because I just keep doing thing after thing trying to make sense of this.. I reinserted some header code and the images are working properly, but the rest of the blog is still totally jacked.

    To be quite honest, I’ve gone a long time just ctrl+F’ing to find what I want to change, and sort of “coming up” with new code to work in a child theme is new.. and stressing me out.

    All I have in there right now is a stylesheet, header.php, and functions.php.

    Aside from the theme import header in my stylesheet, this is all I have in there

    #header {
    	margin-top:20px;
    	padding: 25px 0 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
      	color: black
    }

    and all the header has now is

    <h1 id="header">
      <a href="<?php bloginfo('https://thestylistquo.com'); ?>"><?php bloginfo('The Stylist Quo'); ?></a>
    </h1>
    <div id="header">
     <div id="headimg">
       <h1>
        <a href="<?php echo get_option('home'); ?>">
           <?php bloginfo('The Stylist Quo'); ?></a>
       </h1>
         <div class="description">
           <?php bloginfo('The Stylist Quo'); ?>
         </div>
      </div>
    </div>
    <html> <div id="StylistQuoVintage"><span><div align="center"><a href="<?php bloginfo('https://etsy.com/shop/stylistquovintage') ?>/"
    	title="<?php bloginfo('The Stylist Quo') ?>"
      rel="home"><img src="https://thestylistquo.com/wp-content/uploads/2012/10/sqvheader.jpg"/></a></span></div><br><Br>
      <div id="blog-title"><span><a href="<?php bloginfo('https://thestylistquo.com') ?>/"
    	title="<?php bloginfo('The Stylist Quo') ?>"
    	rel="home"><img src="https://thestylistquo.com/wp-content/uploads/2012/10/cropped-sqletters.jpg"/></a></span></div>
    </html>

    and functions.php has the copied and pasted Google fonts code.

    Thank you for your help! I’ve gotten myself into a mess and I’m just so dang confused at this point. But it’s not good for a style blog to look so… awful.

    the header is missing a lot of vital stuff.

    The header.php in your child theme is used in place of the header.php from your parent theme. So it needs all the code from the parent, which can then be edited

    At the very least you need the non display stuff, from the very first line to the closing head, or relally opening body tag

    and your header has a closing html tag, which is absolutely no good!

    The opening html tag is way out of place too!

    I’d really suggest copying the code from the parent theme into the header of the child theme and starting over…. there is so much wrong in the above code – it’s very difficult to determine what to fix….

    Thread Starter thestylistquo

    (@thestylistquo)

    Do you have a reference for what code I will need? All the stuff to make my blog stop sucking would be preferable

    <?php bloginfo('The Stylist Quo'); ?>

    Also… what are we trying to do here? Have you had a look at:

    https://codex.www.ads-software.com/Function_Reference/bloginfo

    bloginfo only accepts certain parameters…. The Stylist Quo is definitely not on the list! ??

    It’s different per theme, that’s why I mentioned loking at YOUR parent theme! Everything from the 1st line of code to

    <body .... >

    is pretty vital

    The stuff after that is probably too, as it pairs with stuff in your footer.php, etc.

    Thread Starter thestylistquo

    (@thestylistquo)

    Honestly, at that point, I was just trying to fill in blanks. I can never tell what is left to be customized and what is actual code.

    Sorry if I’m a bit slow on this. I can usually handle solid bits of the techy side at a time, but when I’m thrown into it accidentally, I get uh.. stupid.

    Technically… it can all be modified!! But only if we understand exactly what it is doing, and modify it in a functional manner!

    What exactly are you trying to change in header.php? (From the original, it looks like you are working with 2012, is that correct?)

    https://vudu.me/3jq
    Here is my first 2012 writeup on my site – basic tweaking. Again, just trying to provide some concepts to look at with regards to child theming.

    Thread Starter thestylistquo

    (@thestylistquo)

    I’ve fixed it, hallelujah. I can’t believe it took such obvious advice! Gah.

    One last thing.. what exactly do they call the top margin between the title and the very top of the browser? I can only find text-related margins. I want to squish out any excess space between my title image and the top banner.

    Thank you!

    Thread Starter thestylistquo

    (@thestylistquo)

    Also, I’m still getting the error message about the header and line 881..

    Thread Starter thestylistquo

    (@thestylistquo)

    And now I’m getting this

    Fatal error: Cannot redeclare twentytwelve_setup() (previously declared in /home/clhurley/webapps/wp/wp-content/themes/2012child/functions.php:52) in /home/clhurley/webapps/wp/wp-content/themes/twentytwelve-1/functions.php on line 77

    except I’m completely locked out of my blog and WordPress, so I can’t change anything? I attempted deleting the functions.php I had changed, but no dice.

    [ Please do not bump, that’s not permitted here. ]

    That error message is because you can’t copy functions.php from parent to child, or copy specific functions from parent to child.

    You have to make your own function which modifies what is in the parent.

    Also, if you’ve locked yourself out of your site, you need to use FTP or a file manager if your host offers one, and correct the problem in the functions.php file that way.

    And the line 881 error is because you have blank space at the top of your functions.php file You can’t have anything up there, the file must start with an opening php tag, nothing else, not a single blank line/character

    <?php
    // now I can code all I want

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Changed Child Theme, Now Layout Completely Changed and All Customization Gone’ is closed to new replies.