WordPress.org

Ready to get started?Download WordPress

Forums

Adventure Journal
[resolved] Child theme doesn't work (3 posts)

  1. tobiaskochsonlinenet
    Member
    Posted 2 years ago #

    Hi!

    I'm trying to get a child theme of Adventure Journal working, but it simply does not show up.
    I started in small steps changing the font-family for headline elements first, but even this isn't working. The child theme's style.css looks like this:

    /*
    Theme Name:     Adventure Journal Child
    Template:       adventure-journal
    */
    
    @import url("../adventure-journal/style.css");
    
    h1,h2,h3,h4,h5,h6, .h1, .h2,.h3,.h4,.h5,.h6 {
      font-family: Arial, sans-serif;
    }

    I cannot even see the child theme's style.css getting loaded. adventure-journal/style.css is getting loaded however. So everything looks like the basic theme.

    What am I doing wrong?

    Thanks
    Tobias

    http://wordpress.org/extend/themes/adventure-journal/

  2. tobiaskochsonlinenet
    Member
    Posted 2 years ago #

    After some more hours of debugging and searching I found this posting by Chip Bennett that explains and solves part of the problem:

    The problem, most likely, is that the <link> tag for "style.css" in the document head is using get_template_directory_uri(), rather than get_stylesheet_directory_uri().

    If this is the case, then the Child Theme will never have its own stylesheet loaded, because get_template_directory_uri() returns the URL for the *template*, i.e. the Parent Theme.

    Thus, if this is the case, you'll need to add "header.php" to your Child Theme, so that you can change this reference.

    I had to modify the functions.php of Adventure Journal to fix this. The blog's main page uses the right style.css now, but still I cannot get Adventure Journal to include my child theme's stylesheet on single post pages.

  3. tobiaskochsonlinenet
    Member
    Posted 2 years ago #

    Problem resolved. When navigating in the dashboard's theme preview the child theme stylesheet was not included on single post pages for some reason. After activating the child theme these pages are displayed as expected.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic