About WordPress child theme - wordpress

I have created wordpress child theme from parent theme "twentythirteen". My child theme name is "twentythirteen-child".It has following content.
/*
Theme Name: twentythirteen-child
Theme URI: http://www.example.com
Description: A Twenty Thirteen child theme
Author: WPBeginner
Author URI: http://www.example.com
Template: twentythirteen
Version: 1.0.0
*/
#import url("../twentythirteen/style.css");
Unfortunately my child theme replaces the parent theme and newly created theme is applying when i activate child theme and there is no parent theme style is applied on webpage.
How can i solve this problem?

Couple things to try:
Double check to make sure your template path in the header you posted actually goes to the twenty-thirteen theme. That could be why the base styles aren't appearing.
Your child theme needs it's own style.css - you can't import that. Read more on the WordPress Child Theme Codex Page.
Make sure you didn't copy over the entire directory into the child folder. That's a common beginner mistake.
Your child theme is supposed to override the parent theme. It supersedes any parent theme files you put into it. For example, if you put a different page.html in the root of your child theme, it would replace the page.html from the twenty-thirteen parent theme.

Related

How to create a child theme in WordPress?

I am trying to create a child theme so I can customize the parent theme but it is not working what-so-ever. I did everything I can think of:
created a folder for my child theme under wp-content/themes
created a style.css stylesheet and saved it in the child theme folder:
/*
Theme Name: Twenty Thirteen Child Theme
Description: Twenty Thirteen Child Theme
Author: Ashley
Template: twentythirteen
Version: 1.0.0
*/
and I went to Appearance > Themes in WordPress but no child theme showed up. I have tried it multiple times and don't know what to do.
Pretty good tutorial here:
https://www.elegantthemes.com/blog/resources/wordpress-child-theme-tutorial. I've taken a snippet from it for the style.css file, and substituted bits with your info:
/*
Theme Name: Twenty Thirteen Child Theme
Description: Twenty Thirteen Child Theme
Author: Ashley
Template: twentythirteen
Version: 1.0.0
*/
#import url("../twentythirteen/style.css");
/* =Theme customization starts here
------------------------------------------------------- */
Be sure to link properly to the TwentyThirteen theme's style.css file (via #import); make sure you're using the right path. Then you can proceed as normal by visiting "Appearance > Themes".
here is a simple article
create child theme directory
create styles.css
create functions.php

Child themes of twentysixteen theme

I am using twenty sixteen child theme. I need to modify the theme contents. What are the files I need to modify and how? Can anyone explain it in detail.
Advance thanks.
when i use child theme like this i get black screen
This is my site http://i.stack.imgur.com/snSX9.png How to extent the full width of my site..
Read the following documentation about the child themes
Child theme inherits all the functionality and styling of it's parent theme. If you are using child theme and a theme update is applied your changes won't be lost or overwitten
You can quickly create child theme for any theme, just follow the steps given below:
1 Create a folder and name it exactly your theme name; append -child in the name. e.g. creating child theme for twentysixteen theme would be called twentysixteen-child this folder should sit beside parent theme under wp-content/themes/
2- Your child theme should have three files.
style.css
functions.php
screenshot.png
3- In functions.php file you can override parent theme functions.
4 In style.css file you can override parent theme CSS code.
5 If you want to change header design then you have to override header.php file. For this copy header.php file of your parent theme and paste it inside your child theme folder. Now, you can modify the child theme header file as per your requirements.
6 Similarly, you can also override footer.php file in your child theme.
For more info have a look over below thread-
https://codex.wordpress.org/Child_Themes
You need to create at-least one child-theme directory and two main files (style.css & functions.php) under child theme directory. I have given example using Twenty-Thirteen WordPress theme. Step by step explanation is given

Wordpress Child Theme Css not Working

I am using the theme "inkness"
I have created a new folder named "inkness-child" and created there a css file named main.css
But nothing happens when I modify the main.css in the "inkness-child" theme, but it always works on the parent theme. I also used "!important", but still nothing.
And I also activated the child theme, but the modifications does not work.
Here is the code to main.css in the child theme:
/*
Theme Name: Inkness Child
Theme URI: http://click-victor.cu.cc/inkness-child/
Description: Inkness Child Theme
Author: Me
Author URI: http://click-victor.cu.cc
Template: inkness
Version: 1.0.0
#import url("../inkness/css/skins/main.css");
/* =Theme customization starts here
------------------------------------------------------- */
Can you please show me what could be wrong?
Try changing the name of child theme's css file to style.css
Note that the style.css file is enqueued automatically when you create the child theme.

How to activate the child theme in Wordpress?

I create a new style.css and use it in child theme. And I create a new folder in wp-content and name it as themename-child and upload the style.css that I created. Now, I go to wp dashboard -> Appearance -> Themes and I look the child theme that I create. And I found this error:
Broken Themes
The following themes are installed but incomplete. Themes must have a stylesheet and a template.
Name Description
Accesspress Lite The parent theme is missing. Please install the "AccesspressLite" parent theme.
Is there anything that I need to upload? Please help me. I'm new in WordPress. Thank you!
No, the problem here is that you must specify the parent template in commented area of your child style.css
Example from Wordpress Codex
/*
Theme Name: Twenty Fourteen Child
Theme URI: http://example.com/twenty-fourteen-child/
Description: Twenty Fourteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfourteen
Version: 1.0.0
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-fourteen-child
*/
#import url("../twentyfourteen/style.css");
Line with
Template: twentyfourteen
is what your need. Your parent theme must be in corresponding folder, in this example, themes/twentyfourteen.
Also, in your parent template you must load style.css via get_stylesheet_uri() for child theme to work correctly.
Seems clear to me that you need to install the Parent Theme, which is required for child theme installation...
The parent theme is missing. Please install the "AccesspressLite" parent theme.
The whole purpose of the child theme is that it feeds it's adjustments into the parent theme, so you don't have to adjust parent theme settings.

wordpress child theme not working

i am new to word press now i am working on wordpress child theme. now i am going to creat child theme of " Chulavista " theme.
i just creat a sub directory and creat file with name of style.css
in my style.css just place this code
#charset "utf-8";
/* CSS Document */
/*
Theme Name: chulavista Child
Theme URI: agilesoft.us
Description: Chulavista child Theme
Author: Agilesoft
Version: 1.3
License: GNU General Public License
Template: chulavista
Tags:
*/
#import url("../chulavista/style.css");
its simple. but when i activate child theme the layout font and header will be change and show recent post, meta, and category in top menu div.
i can't understand this behaviour. because when i activate parent theme it will be correct.
Please help me out of this problem...
Thanks in advance
Your style.css is correct, your problem is something else.
I will assume that you are working on a Linux Environment.
If you want to install custom themes manually copying your theme directly in the wp-content/themes folder, be sure you create a symbolic link for it as well:
Example:
sudo ln -s /var/www/wordpress/wp-content/themes/your_theme/ /var/lib/wordpress/wp-content/themes/your_theme
I had the same problem as you and I fixed it by creating the symbolic link. Hope this helps.
The Child theme is an individual theme which relies on the Parent's theme files. When you activate the Child theme, you have to set the Appearance settings for the theme. Similar to what you do while activating another Parent theme.
Note that the layout font might be changing due to the same reason.
Does Chulavista support child themes? If it hasn't been written with child themes in mind, it might not properly support them. e.g. if it uses get_template_directory_uri() instead of get_stylesheet_directory_uri(). Check the functions.php and header.php files in the Chulavista theme to see if that is the case.

Resources