wordpress child theme not working - wordpress

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.

Related

why is the Css file codes in wp child theme written as comment line?

i have style.css in the wp child theme. (Below is the sample code) and this code in the comment line. as far as I know comments have no effect on the layout of a document. well, why are these codes written in the comment line??
/*
Theme Name: kabasakal Childtheme
Description:
Author: Kabasakal Reklam Ajansı
Template: kabasakal (you must enter the name of the main theme here!!)
*/
I believe these lines are what Wordpress uses to get the metadata about a theme/file when allowing an admin to choose between themes
https://developer.wordpress.org/themes/basics/main-stylesheet-style-css/
WordPress uses the header comment section of a style.css to display information about the theme in the Appearance (Themes) dashboard panel.
This is a required header comment that goes at the very top of the child theme style.css.
This tells WordPress basic info about the theme, including the fact that it is a child theme with a particular parent.
https://developer.wordpress.org/themes/advanced-topics/child-themes/#2-create-a-stylesheet-style-css

About WordPress child theme

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.

Creating a Wordpress child theme for ThemeCo's Theme X

I want to create a wordpress child theme for Theme X.
How do I import the CSS from the original style from Theme X?
You can download the official child theme for X here: https://community.theme.co/kb/how-to-setup-child-themes/
Or you could create your own as long as you then edit the child's style.css to include a line such as this since X doesn't store its CSS in the same file:
#import url( '../x/framework/css/site/stacks/integrity-light.css');
Source: https://community.theme.co/forums/topic/child-theme-not-working/
Generalized steps for creating child theme for any theme:
1) create a directory in your themes directory in wordpress:
/wordpress/htdocs/wp-content/themes/Your-child-theme
2) create a style.css file in that directory.
3) open the newly created style.css file and add header information:
/*
Theme Name: Your child theme name
Author: Author name
Template: Your parent theme name
*/
4) Import the parent theme stylesheet,
after the header add in your style.css:
#import url('../Your_parent_theme/style.css');
If your parent theme have only one stylesheet, then these steps are sufficient. Otherwise you can add multiple import statements.
Check wordpress codex: https://codex.wordpress.org/Child_Themes
Note that there is no child theme packaged with the theme zip archive like most others. You have to login to Themeco's member area to download it, which requires an Envato username and theme purchase code for registration.

MailPress Child Themes

I found the solution, so I'll post this in case anyone else is looking for this info.
I was looking into using a child theme with MailPress (the Wordpress newsletter plugin).
I created the following folder:
public/mysite/wp-content/plugins/mailpress/mp-content/themes/twentyten-child
But when I went to the Admin->Mails->Themes page to activate this child theme, it showed the error:
The parent theme is missing. Please install the "twentyten-child"
parent theme.
The answer was to insert the following comments at the top of the child theme's style.css file:
/*
Theme Name: twentyten Child Theme
Template: twentyten
Version: 0.1
*/

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.

Resources