Wordpress theme css file - wordpress

According the Wordpress' doc, when we create theme, we need to create style.css file in the same place with other files like header.php, footer.php, however, to make a better organization of files, I put all css files in a sub folder.
Then there comes the problem, when I go to the admin area, Appearance -> Editor, I can not see the sub folder so can not edit those css file in the sub folder.
Please help, thanks.

create style.css on your theme folder and have it's content:
/*
Theme Name: Your theme name
Theme URI: http://example.com/
Description: Your theme description
Author URI: http://example.com/
*/
#import('themesubfolder/yourfile.css');

There seems to be a problem in WordPress (still existing at version 3.3.1 as far as I can tell) where CSS files in a sub directory of a child theme are not recognized. For me, the problem isn't only with not seeing such files in the "editor." CSS files that are in subdirectories simply do not work.
Yes, you can use #import in your main CSS file to include another CSS file that's in the child theme's directory, but it must be at the same level as the main CSS file. After several hours of frustrating experimentation, my conclusion is: CSS files that are in a sub folder of a child theme are ignored.

Do one thing, delete old CSS file and replace it with new CSS file, if you have two-three CSS then d'nt worry about that, place other CSS file with Header.php, footer.php, index.php...
Call that CSS file with "/FILE NAME"

Related

How to override a file located in Main theme sub folder and override it in child theme

In my main theme, I have a file I need to edit
main-theme/inc/widgets/activates/widget-active.php
Problem: How can I edit/override the widget-active.php in my child-theme?
I tried creating the same folder structure in my child theme but it doesn't work, tried searching for solutions but didn't saw what I was looking for.

Wordpress Mezzanine Flat Theme - shortcode.php in ChildTheme

It seems that an edited copy of shortcodes.php in child-theme of mezzanine flat theme is not working (does not override the parent theme)
I tried copying the whole lib folder where shortcodes.php is located but still not working. Is there anything I need to do to make it work? Other common pages of wordpress (i.e. header and page) override smoothly on child pages.
Thanks in advance.
You can't override shortcodes.php because the child theme replace only template files
But you can create a new file, like custom_shortcodes.php with your custom shortcode, save in your child theme and then include it in functions.php ( include 'custom_shortcodes.php'; )

How to make a child theme after style.css has been customized

I am working on a theme that has already been customized. Only one file in the theme has been customized, that file is the style.css. A child theme was NOT created before doing the customizations.
I would like to make a child theme so the customizations are not lost when the theme is upgraded. How do I add the customizations in the style.css to new child theme?
Thank you.
you should check your all files and folders of theme . sometime your theme has a dynamic css file like sass, less or other .... if you have a dynamic css file, you should customize that file ....
if you haven't dynamic css files, you can customize your main css file as you want.

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.

How do I use new add_editor_style() function in wordPress?

I found this article:
http://www.deluxeblogtips.com/2010/05/editor-style-wordpress-30.html
I created a child theme using the Twentyten theme as a parent. I am trying to have the WYSIWYG editor use a custom stylesheet.
I added this to my functions.php file:
add_editor_style();
Then I created an editor-style.css file in my child theme's folder and added this:
html .mceContentBody {
max-width:591px;
}
When I go to the WYSIWYG editor and use firebug to check the css that is affecting the .mceContentBody element, I can see that is using my stylesheet, but it is being overrriden by the default editor-style.css sheet from the twentyten theme.
How can I force it to use my editor-style.css file and not the default one?
add_theme_support('editor_style');
before
add_editor_style('tinymce-styles.css');
assuming that your custom css is in your template's root folder.
Try redeclaring twentyten_setup in your theme's functions.php file. Just copy and paste the whole function from twentyten to your theme.
Check your CSS for errors. I spent hours pulling my hair out wondering why wordpress wasn't using my stylesheet. It wasn't even getting included. Turns out i had an extra { in my css.

Resources