• Resolved Thedailycheers

    (@thedailycheers)


    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;
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • my child theme on my Localhost WP is not “talking” to my parent theme on my Bluehost WP

    themes have to be on the same server.

    also, a child theme uses the information from the parent theme, but does not influence the parent theme, i.e. if the parent theme is activated, you will not see anything done in the child theme..

    you will need to have the child theme activated.

    Thread Starter Thedailycheers

    (@thedailycheers)

    Hello Alchmyth,
    Thank you so much for helping. I have activated child theme at the localhost, so I need to also activate it at the bluehost, yea? How do I activate the child theme at the Bluehost?

    Same way – login to your site on BlueHost and under Appearance > Themes activate the child theme.

    But as he said above, your localhost installation and your Bluehost site are not connected at all. They are totally separate WP sites.

    Thread Starter Thedailycheers

    (@thedailycheers)

    Thanks for all your help! Child’s theme is working perfectly for a few days! YAY!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘My child theme is not linking to my parent theme. They are not "talking"’ is closed to new replies.