• Resolved SkylerGainsb

    (@skylergainsb)


    This is my first time creating a child theme. I’m making it for dene-tha.com.
    I created style.css and put it in the appropriate folder for my theme (fashionistas-child). This works, however, the site then has no styling.
    So when I go on to create the code for the functions.php file, the site will not resolve. This is the code I used from the codex:

    (<?php)
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
        );
    }

    My theme has more than one style sheet, so I’m guessing this is the problem. However, I don’t know how to account for the other .css files.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Remove the parentheses around the opening php tag. It should be

    <?php

    Thread Starter SkylerGainsb

    (@skylergainsb)

    Thanks WPyogi. That seems to have worked. One more related question and one issue however:

    1) What is the relationship between the child theme style sheets I just created and the changes I make in CSS Stylesheet Editor via Jetpack? Where should I be coding ideally?

    2) It now seems that the site title font has an added stroke width, but only on the home page. Is this because of my other style sheets in the theme not being referenced? I read something in the codex that this would only work for themese with one .css file. Mine has four.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What is the relationship between the child theme style sheets I just created and the changes I make in CSS Stylesheet Editor via Jetpack?

    None, one is related to a plugin and the other a theme. They do not relate to each other.

    Where should I be coding ideally?

    In one place.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    2) It now seems that the site title font has an added stroke width, but only on the home page. Is this because of my other style sheets in the theme not being referenced?

    If you look at the HTML behind your page (i.e. with Firebug), you can see that your Home page uses different HTML for your site title. It uses a level 1 heading (which has the bold style).

    Thread Starter SkylerGainsb

    (@skylergainsb)

    Thank you Andrew. I’m new to this stuff. This issue came up after I created the child theme, so I’m not sure what went wrong. I see now that the code on that page points to a level 1 heading, but how/where do I change this? Do I add the appropriate code into my child theme’s style.css file? What would that code be to make it point to that page?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Child Theme funcions.php breaks site’ is closed to new replies.