WordPress.org

Forums

Child Theme being ignored by 2012 (11 posts)

  1. Psychel
    Member
    Posted 1 year ago #

    Hi,

    For starters: Anyone who helps thanks in advance; this is my first time using WordPress and I'm not really a coder.

    Meat and Potatoes: I created a child theme for my site http://www.Workcraft.net. On that child theme I created a custom CSS Stylesheet as well as a custom Header.php (which I uploaded through FTP). I have enabled the 2012-child theme and I have put (what I think) are the necessary lines of code in the child-theme for it to work with the parent theme. None of the changes are going through. I called technical support for my website and they told me to contact someone here and state this: It appears wordpress is ignoring the files that are located under the child theme, it’s not even finding them. Not even parsing through/loading them. Not a problem with php. The lines of code written by tech support to check the php have been denoted.

    In case the changes I desire are not clear through my code I'll do my best to explain what I'd like my site to look like-- I'd like the Header to be an image (the one that's in the header.php code --> http://i.imgur.com/AVXXmFW.gif) and, with regards to the CSS stylesheet, I'd like to replace the word "Earth" on the menu with an icon (the code for which is in the stylesheet) as well as change the thickness of the menu bar and the thickness and placement of some of the menu items themselves.

    I know there have been many issues with child themes and their various interactions, so, I apologize if this topic is beating a dead horse. I'm afraid I don't know enough to do anything other than pick up a stick and beat the poor thing myself. Again, Thanks for the help.

  2. CrouchingBruin
    Member
    Posted 1 year ago #

    What did you call the child theme, twentytwelve-child? Are you sure you activated the child theme and are not working from the parent theme? When I do a view source of your site, I see a reference to the parent theme's style.css file, not the child theme.

    <link rel='stylesheet' id='twentytwelve-style-css'  href='http://workcraft.net/wp-content/themes/twentytwelve/style.css?ver=3.8.1' type='text/css' media='all' />
  3. Psychel
    Member
    Posted 1 year ago #

    Hey CrouchingBruin,

    Thanks for responding! Yes, I named the child theme "twentytwelve-child". The theme says "This child theme inherits templates from a parent theme, Twenty Twelve"

    I have activated it. I have also activated the 2012 theme simultaneously (is this wrong?).

  4. CrouchingBruin
    Member
    Posted 1 year ago #

    Only one theme at at time is considered "active." Unlike plugins, it is impossible to have two themes active simultaneously. Once you activate one theme, the previously active theme becomes inactive. Go back and activate your child theme again.

  5. Psychel
    Member
    Posted 1 year ago #

    I see. Thank you so much for making me re-check that! I definitely didn't have it on (I was confused because of the whole enable thing in one the theme menus. It seems I can access my theme menu in 2 ways). My bad!
    However, now, the header isn't aligned properly and the menu is all sorts of wonky. Could you possibly tell me what's wrong with my code?

    Thank you so much! It's awesome to see progress :)(even if it's cuz I forgot to do something as simple as turn on the light, lol)

  6. CrouchingBruin
    Member
    Posted 1 year ago #

    You're not importing in the parent theme's CSS because the import statement is contained within the header comment:

    @import url("../twentytwelve/style.css");
    */

    Move the import statement after the closing comment mark:

    */
    @import url("../twentytwelve/style.css");

    Also, when I examine your child theme's style.css file, I see odd clauses, like style.css.1464 and workcraft.net/ scattered about; those will have to be removed or your CSS file will have syntax errors and some of your rules may fail to be interpreted properly.

  7. Psychel
    Member
    Posted 1 year ago #

    You Are Awesome. Thank you. I still have a couple of issues though. For one thing, how should I go about centering the title: should I go through the header.php or the stylesheet.css (and if I could be so greedy since I just spent 20 or so minutes looking up how to move the header with conflicting answers, could you tell what code I should use and where to place it...Thank you.)

    Also, the other CSS things I have written didn't take effect (like the margin changes). They work when I play with them through Inspect Element, but, not in any other way.

    You are making my week :)

  8. CrouchingBruin
    Member
    Posted 1 year ago #

    They work when I play with them through Inspect Element, but, not in any other way.

    OK, now I understand why your CSS file looked a bit strange, you're copying & pasting directly from the web debugger. The only other thing you need to get rid of are all the lines that read media="all".

    Also, for your media queries, you need to enclose the rules in an extra set of braces. Or, what's easier is to combine rules which share the same media query.

    So instead of this:

    media="all"
    @media screen and (min-width: 600px)
    .main-navigation li a {
       border-bottom: 0;
       border-bottom-width: 0px;
       border-bottom-style: initial;
       border-bottom-color: initial;
       color: #6a6a6a;
       line-height: 4;
       text-transform: uppercase;
       white-space: nowrap;
    }
    
    media="all"
    @media screen and (min-width: 600px)
    .main-navigation li a {
       display: inline-block;
       text-decoration: none;
       height: 28px;
       width: 17px;
    }

    Change it to this:

    @media screen and (min-width: 600px)
    {
       .main-navigation li a {
          border-bottom: 0;
          border-bottom-width: 0px;
          border-bottom-style: initial;
          border-bottom-color: initial;
          color: #6a6a6a;
          line-height: 4;
          text-transform: uppercase;
          white-space: nowrap;
       }
    
       .main-navigation li a {
          display: inline-block;
          text-decoration: none;
          height: 28px;
          width: 17px;
       }
    }

    The indentation isn't important, I just nested it a certain way so you could see that the two CSS rules are enclosed by brackets which are part of the media query (the line that starts @media screen).

    To center-align the site title, add this rule:

    .site-header h1 {
       margin-left: auto;
       margin-right: auto;
       text-align: center;
    }
  9. Psychel
    Member
    Posted 1 year ago #

    HAHAHA! YOU ARE THE BEST!!! :D I'm going to be trying to be fiddling with the menu now and I can foresee a couple of troubles happening. Should I start a new thread or can I continue to ask questions here? Since they won't really be about the child theme.

  10. CrouchingBruin
    Member
    Posted 1 year ago #

    Technically you should start a new thread, and probably over on the Twenty Twelve support page. You're more likely to get an answer that's more pertinent to the theme if you post over there. Other users who may have the same problem will be able to find a solution if you start a new thread as well.

  11. Psychel
    Member
    Posted 1 year ago #

    You got it! Thank's very much everything! You made what was going to be a pain into a pleasure :)

Topic Closed

This topic has been closed to new replies.

About this Topic