My child theme is not linking to my parent theme. They are not "talking"
-
Hello WP, `
I am very new to WP, and I have been working on a child theme for twentyfifteen. I used the child theme to add an “Image Credit” field at the end of the post (first mini tryout for child theme). I have followed the child theme article in the forum. Everything is fine to the step where my child theme on my Localhost WP is not “talking” to my parent theme on my Bluehost WP.Currently, my child theme shows the “Image Credit” field (good news), but my parent theme does not. They are not linking together. What am I not doing correctly? All help is appreciated.
my child theme style.css
/*
Theme Name: Twenty Fifteen Child
Theme URI: https://example.com/twenty-fifteen-child/
Description: Twenty Fifteen Child Theme
Author: John Doe
Author URI: https://example.com
Template: twentyfifteen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-fifteen-child
*/.after-post-section h3 {
color: #333;
font-size:1.3rem;
display:inline-block;
font-family: ‘Noto Sans’, sans-serif;
font-weight:700;
margin: 0 0 1em 0;
line-height: 1.2;
opacity:0.7;
text-transform: uppercase;
vertical-align: baseline;
}.after-post-section h3::before {
content: “”;
display: block;
width: 100%;
min-width: 30px;
border-top: 1px solid #ddd;
margin-bottom: 1em;
}.after-post-section .section-content {
font-size: 0.8em;
}my child theme functions.php
<?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_uri(), array( ‘parent-style’ ) );
}add_action( ‘the_content’, ‘my_image_credit’, 12 );
function my_image_credit( $content ) {
if( is_singular() ) {
$image_credit = get_field( ‘image_credit’ );
if( !empty( $image_credit ) ) {
$content .= ‘<div class=”after-post-section”><h3>Image Credit</h3><div class=”section-content”>’ . $image_credit . ‘</div></div>’;
}
}return $content;
}
- The topic ‘My child theme is not linking to my parent theme. They are not "talking"’ is closed to new replies.