• I set up a child theme which, at the moment, contains very sparse style.css and functions.php files. With the child theme loaded, the archive links on the left sidebar take you to a blank page. Click on a month (ie June 2014) the browser is redirected to website.com/2014/06 but the page is blank.

    If I change to the Dusk to Dawn theme itself, not the child theme, the links work.

    Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Hi there, can you post what is in your functions.php file here for us to look at? Place it between code tags.

    Thread Starter hamanidaba

    (@hamanidaba)

    Hi sacredapth,
    My functions.php file:

    <?php
    add_action( 'wp_enqueue_scripts', 'my_enqueue_styles' );

    function my_enqueue_styles() {

    /* If using a child theme, auto-load the parent theme style. */
    if ( is_child_theme() ) {
    wp_enqueue_style( 'parent-style', trailingslashit( get_template_directory_uri() ) . 'style.css' );
    }

    /* Always load active theme's style.css. */
    wp_enqueue_style( 'style', get_stylesheet_uri() );
    }
    ?>

    Moderator Kathryn Presner

    (@zoonini)

    Hi there, this is the code I’d recommend to enqueue your child theme’s styles, instead of what you posted above:

    <?php
    
    function dusktodawn_child_enqueue_child() {
    	wp_register_style( 'dusk-to-dawn', get_template_directory_uri() . '/style.css' );
    	wp_enqueue_style( 'dusk-to-dawn-child', get_stylesheet_uri(), array( 'dusk-to-dawn' ) );
    }
    add_action( 'wp_enqueue_scripts', 'dusktodawn_child_enqueue_child' );

    This assumes your parent theme folder is called dusk-to-dawn and your child theme folder is called dusk-to-dawn-child. If they’re named something else, just replace the above references with your own folder names.

    I tested a Dusk to Dawn child theme with an archives widget and it works fine. Let me know how it goes.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Archive links broken when using child theme’ is closed to new replies.