• Resolved avr123

    (@avr123)


    Hello,

    I started tinkering around with a couple of elements of the twentythirteen theme before finding out that it would be maybe be better to have created a child theme.

    e.g.
    I replaced the powered by wordpress footer
    Uploaded a new image header
    changed the site tile and tagline font colours

    Just small things.

    Now thinking that the thing to do is create a child theme in case there are any more updates to the theme.

    Created a child theme as per instructions
    i.e.
    twentythirteen-child folder in themes folder
    created style.css
    added the footer.php to the folder

    When i went to Themes, the child theme was listed but no image was shown.
    Selected ‘live preview’ and it displayed but without expected formatting in posts (like it is not picking up the styles).

    The stylesheet had:
    /*
    Theme Name: twenty thirteen child
    Theme URI: https://example.com/wp/wp-content/themes/twentythirteen-child
    Description: none
    Author: none
    Author URI: https://example.com/wp
    Template: twentythirteen
    Version: 0.1
    */
    /*
    For older themes, and themes that do not use wp_enqueue_style() to enqueue their stylesheet, use the following line where
    twentyfourteen is the name of the directory where the theme resides:

    @import url(“../twentythirteen/style.css”);
    */

    /* =Theme customization starts here
    ————————————————————– */

    and then just copied and pasted from style.css into the new style.css in the child folder – mainly thinking that if I couldn’t remember what changes I had made, putting the entire listing in would do the trick.

    Sure enough – when I did live preview again, the formatting I was expecting to see in the posts was working again – except that site title and tag fonts had reverted to black, so it seems I’m not doing it correctly.

    Questions:
    Is it expected behaviour that a child-theme does not show an image in the theme gallery (just checkered background).
    I read that files to go in the childtheme folder should be those that I’ve changed (like footer.php) but should I need to manually copy in the content of the stylesheet to style.css in the child theme folder?

    Because I’d already made changes in the main theme, I expected to see these in the child theme not have it revert image and font colours.

    Can’t give a link because the site is live and I can’t activate the child – just trying to get it to work in preview before risking activating it.

    Any ideas, suggestion or pointers at more stuff explaining how this works gratefully received.
    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • In your child theme’s stylesheet, the @import line should be outside of the comment block (which is indicated by /* */):

    /*
    For older themes, and themes that do not use wp_enqueue_style() to enqueue their stylesheet, use the following line where
    twentyfourteen is the name of the directory where the theme resides:
    */
    @import url("../twentythirteen/style.css");

    You don’t need to copy and paste the styles from the Twenty Thirteen theme into your child theme because that @import line already does it for you. The only styles you need to put in your child theme’s stylesheet are the ones that should be different from the parent theme.

    Finally, the image in the theme gallery is taken from a file named screenshot.png in the theme’s directory.

    Thread Starter avr123

    (@avr123)

    Thank you!
    I’ll change @import line

    Thread Starter avr123

    (@avr123)

    A custom header image was added via the media library, can you tell me if there is a specific .php file that needs to be copied over to the child theme folder, please?

    Also, whilst the posts now have their styling, the main blog title and tagline are showing font colour as white using the parent twentythirteen theme, but black in the live preview of the child theme – sorry, I must be missing something obvious – any ideas?

    Thanks for your help.

    You’ll have to reapply that custom header to your child theme the same way you did with the parent theme: Appearance > Header. In that same panel, you can also change the color of the site title and tagline.

    Thread Starter avr123

    (@avr123)

    Brilliant. Thank you very much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘child theme from twentythirteen’ is closed to new replies.