• Resolved Jane Milburn

    (@jane-milburn)


    Hi, I know this question has been asked before but I need to activate my child theme for Twenty Seventeen Version: 1.3.

    I have searched online for answers and tried many solutions but they do not work for me. I created the necessary child theme files/folders used Filezilla to activate the child theme and Filezilla says that the status is File transfer successful, however the child theme does not appear under Themes in my dashboard.

    I have recently installed the Styles plugin (which incidently also does not work) and activated Jetpack.

    The site https://www.plinthism.com/ was only set up a few days ago.

    I have cleared my cache and refreshed the Themes page many times including refresh with F5.

    I have tried two variations of my child theme style.css which can be seen here I think (i’m still unsure what link from Pastebin I need to post here).

    https://pastebin.com/KxhkPhU8

    https://pastebin.com/sXQVyqNQ

    Any help in having a working Twenty Seventeen child theme would be much appreciated.

Viewing 14 replies - 16 through 29 (of 29 total)
  • Thread Starter Jane Milburn

    (@jane-milburn)

    I deleted the other themes from my WordPress dashboard to just make it look more neat. Yes I can contact my hosting provider. I will do that. I am so grateful that you have spent time trying to sort this for me. I will post later to update you as to what Fasthosts have said. Many, many thanks ??

    Bert O

    (@websitehelperberto)

    Did you add a functions file in your child theme?

    Your child theme should have (minimum) a stylesheet and a functions file.

    So you want:

    style.css
    functions.php

    The function file should include the following:

    
    <?php
    // Register parent style
    add_action( 'wp_enqueue_scripts', 'mychildthemename_enqueue_parent_styles' );
    function mychildthemename_enqueue_parent_styles() {
    wp_enqueue_style( 'mychildthemename_enqueue_parent_styles', get_template_directory_uri().'/style.css' );
    }
    
    • This reply was modified 7 years, 1 month ago by Bert O.
    Thread Starter Jane Milburn

    (@jane-milburn)

    Thank you websitehelperberto. I tried what you suggested but still no luck. I contacted the hosting company with a ticket but they still have not got back to me!

    Hi Jane,

    This is the way I have set up my child themes;

    A child theme directory must be created that sits in the same directory as the parent theme. It must have the same name as the parent but with ‘-child’ appended. E.g.
    ……./wp-content/themes/twentyseventeen-child.

    WP will not recognise a child theme until the directory twentyseventeen-child contains a stylesheet named style.css The style sheet must contain certain header information, e.g.

    /*
    Theme Name: Twenty Seventeen Child
    Theme URI: https://newvoo.com/wp-content/themes/twentyseventeen-child
    Description: Child theme to customise newvoo.com website
    Author: Mark Dressel
    Author URI: https://newvoo.com/
    Template: twentyseventeen
    Version: 1.0.0
    License: GNU General Public License v2 or later
    License URI: https://www.gnu.org/licenses/gpl-2.0.html
    Tags:
    Text Domain: twentyseventeen-child
    */

    In the child themes style.css file we put style rules to override the parent themes styles, but unless told otherwise WordPress will ignore the stylesheet in the parent theme and use only the child theme stylesheet. So to keep the parent theme css we must put some code in a file named functions.php loaded into the twentyseventeen-child directory.

    function enqueue_theme_resources() {
    // NOTE get_template_directory_uri() is path to parent theme,
    // get_theme_file_uri() is path to child theme.
    // Call the parent style sheet so we have both parent
    // and child style sheets.
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘enqueue_theme_resources’);

    Adding this CSS rule to the child theme style sheet will show if the child theme is being used;
    .site-title:before{
    content: ‘using child theme’;
    }

    I hope this helps, though you may already have been through these steps.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Hi HairLoss57, I have been through those steps but I really appreciate your help, thank you. I have followed your instructions adding functions.php but still nothing. The hosting company still have not got back to me, maybe I should think of changing them, but that’s another story!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    As it’s been a long time since my last reply, I’m just letting you know I’m subscribed to the thread and you can respond at any time.

    Thread Starter Jane Milburn

    (@jane-milburn)

    Hi again Andrew Nevins (@anevins), the hosting company finally got back to me and after lots of toing and froing they finally got the child theme to appear in my dashboard in Themes but told me they created the style.css and functions.php in FTP.

    Now, after clicking preview (I didn’t want to activate it in case there were further problems) all I see in preview is a white screen. I have asked the hosting company what they did to make the child theme appear, what the style.css and functions.php they managed to upload says and why there is a white screen in preview, I am waiting to hear, infact i’ve been waiting all day.

    I’ve a feeling it’s a problem their end as although all my FTP login details are correct (they said the details are correct), when I try to upload anything I get the error –
    Response: 530 Login failed. Please verify the username and password supplied, and that FTP has been unlocked. Check your control panel or contact support for more information.
    Error: Critical error: Could not connect to server

    I want to change the hosting company but apparently I can only do that once the package with them has been active for 60 days which it has not!

    I will keep you updated and let you know what they say in hope that this post may help someone else with the same problem.

    Thread Starter Jane Milburn

    (@jane-milburn)

    The preview still shows a white screen. After having to wait ages, the hosting company today told me –

    “Couldn’t find any details about the issue in our error logs. This is a website content related issue which is slightly outside our area of expertise, therefore, if you have the possibility to contact a web developer for assistance with theme related problem, that would be recommended.”

    Would someone please take a look at the style.css and functions.php they added and let me know if they are correct and if they are correctplease advise me as to why I am still seeing only a white screen in the child theme live preview, thank you. –

    /*
    Theme Name: Twenty Seventeen Child
    Theme URI: https://mysite.com/wp-content/themes/twentyseventeen-child/
    Description: Child theme to customise mysite.com website
    Author: Jane Milburn
    Author URI: https://mysite.com/
    Template: twentyseventeen
    Version: 1.0.0
    License: GNU General Public License v2 or later
    License URI: https://www.gnu.org/licenses/gpl-2.0.html
    Tags:
    Text Domain: twentyseventeen-child
    */

    <?php
    function my_theme_enqueue_styles() {

    $parent_style = ‘$parent_style = ‘twentyseventeen-style’;

    wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’,
    get_stylesheet_directory_uri() . ‘/style.css’,
    array( $parent_style ),
    wp_get_theme()->get(‘Version’)
    );
    }
    add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
    ?>

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }

    I am so confused!

    Barinto

    (@bigbtc)

    Hi Andrew Nevins @anevins, everything works well with this theme except when using a “menu button” to move to the the next section, a small part (say 1 inch) of the “header media” (sized 2000×1200) remains in view at the top of each section. I have to use the scroll bar to position the section properly to remove the small piece of header media showing. This also happens with the default header image that comes with the WP Theme. Can you assist with this please, thank you.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    There is a syntax error in your PHP code:

    
    
    $parent_style = ‘$parent_style = ‘twentyseventeen-style’;
    

    Instead it should be this:

    
    
    $parent_style = ‘twentyseventeen-style’;
    
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Barinto

    (@bigbtc)

    Yes, thank you I have opened a new thread,

    Thread Starter Jane Milburn

    (@jane-milburn)

    I can hardly believe it, that’s amazing Andrew Nevins (@anevins). Thank you soooooooo much. it’s there.

    It appears I now have a fully functioning child theme thanks to you taking the time and effort to help me. From this, I have learned to double check everything particularly code and be patient.

    I hope this can help someone else with a similar problem.

    This topic has now been solved ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You’re welcome, I’m glad it’s there. It would have been a lot easier if your hosting providers could have been more helpful.

Viewing 14 replies - 16 through 29 (of 29 total)
  • The topic ‘Twenty Seventeen Child Theme’ is closed to new replies.