• Resolved roland.nilsson

    (@rolandnilsson)


    I’m new to WordPress, so apologies in advance if this is a known issue, but could not find anything in FAQs or forums. I recently made a simple child theme from twentyfourteen, aiming to change the body text font for posts a bit. Strangely, the child theme works as expected when accessed through the main site URL https://www.rolandnilsson.net, but when accessed through a direct URL for a post, such as this one, it reverts to the parent’s font setting. What’s up?

    Here is the child’s style.css:

    /*
     Theme Name:   Twenty Fourteen Child
     Author:       Roland Nilsson
     Author URI:   https://www.rolandnilsson.net
     Template:     twentyfourteen
    */
    
    #main-content p  {
        font-family: book-antiqua, palatino, times-new-roman, serif;
        text-align: justify;
        text-justify: inter-word;
        hyphens: auto;
    }

    And this is functions.php (from the codex):

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

    I looked at the HTML generated and it does seem to use twentyfourteen-child/style.css in some places. Perhaps the CSS is not correct?

    Many thanks in advance for any help.

Viewing 1 replies (of 1 total)
  • Thread Starter roland.nilsson

    (@rolandnilsson)

    Okay, I think I solved it already. It was the CSS after all, added the properties .entry-content as well and now it looks correct. Guess I have a lot of digging through the style sheets to do ??

Viewing 1 replies (of 1 total)
  • The topic ‘Child theme from direct URLs’ is closed to new replies.