1
votes

here I have a site, tinywolf.uk that i'm currently working on. The homepage is a static site separate from wordpress, but the blog part of the site http://www.tinywolf.uk/blog will be powered by wordpress.

Im currently using the twenty-fifteen theme, and would like to have the header and footer from the homepage in the blog as well for continuity.

So far I have created a child theme, and then a new header.php file which contains the header from the homepage. This replaces the existing wordpress header.php and displays correctly, however, the styling for the rest of the theme has disappeared. I want to maintain the styling for the posts.

How do I call the correct styling from the twenty-fifteen theme to ensure that the content (blog posts) are correctly styled?

here is my code for the child-theme header.php

I have tried including the style.css for the twenty-fifteen theme using <link rel="stylesheet" and although this brings up some of the formatting it also breaks the structure of the page.

here is the content of my functions.php:

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

and this is my child style.css:

    /*
 Theme Name:   Tiny Theme Child
 Theme URI:    http://example.com/twenty-fifteen-child/
 Description:  Twenty Fifteen Child Theme
 Author:       Joel S
 Author URI:   http://www.tinywolf.uk/blog
 Template:     twentyfifteen
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fifteen-child
*/
2

2 Answers

0
votes

you have to link parent theme style.css in your child theme. Here is a good example from codex

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}

codex

0
votes

If I understood true, you want to have your static page header and footer on your wp. The only thing you need is make a copy of both parts from your static page put on separate files named header.php and footer.php then change the codes as title code to become dynamic WP codes. After that call them into your theam.

But, If you want using child theme do like this:

Follow all steps above and named your files as e.g. header-child.php & footer-child.php then call them like this: <?php get_header('child'); ?>

remember: header and footer must be first of your files name you cannot make like child-header.php. would not works.