• Resolved Lloyd

    (@llolee)


    Hello,

    I’m having trouble modifying my child theme to match my website – my website isn’t running on WP, but I installed WP in a sub directory (/blog) and have nearly gotten everything (aesthetically) straightened out except for the footer. I can’t seem to get it the footer section to pull formatting completely from the .css files, only partially. Here’s what I mean:

    original site:
    lloydiv.ninja

    blog:
    lloydiv.ninja/blog

    Any help or suggestions would be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • CrouchingBruin

    (@crouchingbruin)

    As far as the font goes, the footer isn’t using the Montserrat font-family because you don’t have a link to the Google font. For example, if you do a view source on a non-blog page, you’ll see these links in the head section:

    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

    These links define to the browser where to find the particular fonts being brought in from Google, including where the browser can download the font. The first stylesheet is for the Montserrat font, which is used for the headings in the footer (actually, it’s used for all h# headings).

    So, you’ll need to include a link to the font stylesheet the same way in your blog page. Two ways you can do that:

    1. In your child theme, make a copy of the parent theme’s header.php file (if you haven’t done so already) and add the link to the stylesheet there. It shouldn’t be too hard to figure out where to put it, find a line of code with a similar link.
    2. Use a plugin like Header and Footer, which you can use to add such links to the head section of every page.
    CrouchingBruin

    (@crouchingbruin)

    The same problem affects the social media buttons. You need to include a link to the FontAwsome fonts:

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    You’ll see this if you do a view source of your non-blog page as well.

    Thread Starter Lloyd

    (@llolee)

    @crouchingbruin – I should have been a bit more clear. I don’t understand why it’s not centering. Thank you for the help with the fonts though.

    CrouchingBruin

    (@crouchingbruin)

    Ah, yes, interesting. The rule for footer.text-center should override the text-align rule for h3 and p since it has a higher specificity (11 versus 1). I’ll have to dig into it a bit more.

    CrouchingBruin

    (@crouchingbruin)

    Wow, that’s really got me perplexed. The only suggestion I can give you is to alter this rule in your child theme’s style.css file from this:

    footer.text-center {
      text-align: center;
    }

    to this:

    footer.text-center * {
      text-align: center;
    }

    This will target all of the children of the footer.text-center element.

    Thread Starter Lloyd

    (@llolee)

    @crouchingbruin – that works, thank you. Still a little confused as to why it wouldn’t work before, but maybe it’s a mystery left to be unsolved 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Child theme specific CSS question’ is closed to new replies.