stylesheet child theme issue - woothemes canvas - wordpress

I encountered a problem with my wordpress (canvas) site in ie8 and traced it to the stylesheet link in the header of my child theme - this code:
href="<?php bloginfo('stylesheet_url'); ?>"
translates in the browser as "...canvas-child/style.css" which is wrong - according to woothemes instructions you should customize css in your child theme with 'custom.css' only, and leave 'style.css' in your parent 'canvas' theme. I really need to know 1. is this an error 2. what should this php code be pointing to? Thanks.

Check out: http://codex.wordpress.org/Child_Themes for information on child themes.
style.css is the one and only required file in a child theme. It provides the information header by which WordPress recognizes the child theme, and it replaces the style.css of the parent.
When you use Child Templates, just copy a file with the same name to your child theme and enter your adjustments here.

Related

How to change the CSS for links in a BuddyBoss theme

I know what kind of styling I want, and how to program in CSS and I have equired a BuddyBoss theme and I have asked on their forum for help but they haven't got back to me so I'm wondering if someone can help.
How would I go about changing the style of a particular link in a BuddyBoss theme?
We recommend adding all of your CSS edits into your child theme at /themes/buddyboss-child/css/custom.css. Any styles added to this stylesheet will overwrite styles set in the parent theme’s /css/ folder.
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
type="text/css" media="screen, print" />
According to above you can add your style sheet.
Create a file buddypress.css in your css folder.
Add BuddyPress Styles to a Theme
BuddyPress 1.7 adds the ability to use any WordPress theme. The theme compatibility has a base style sheet that helps format the BuddyPress content. The styles may not be perfectly suited to your theme.
It’s very easy to add your own styles. If your theme folder has a sub folder called css you only need to add a stylesheet buddypress.css to this folder and BuddyPress will use this file overriding the BuddyPress styles. If the css folder is missing just create one and include the file inside. You can copy the buddypress.css file from the BuddyPress plugin folder and edit or create your own.
Theme Developer:
If you want to ship your theme with extra styles to support BuddyPress add the BuddyPress styles to the buddypress.css file and include it in your theme. Do not add the BuddyPress styles to your style.css file. This will ensure the styles are only loaded when BuddyPress is activated and will override the default styles supplied by the plugin.
Prefix your styles with #buddypress to target the areas of BuddyPress content.
#buddypress .activity-content {
}
*NOTE As of 1.8 you can place the file in /my-theme/community/css/ or /my-theme/buddypress/css/
check this link
https://codex.buddypress.org/themes/theme-compatibility-1-7/add-buddypress-styles-to-a-theme/

Right way to get image path

Called the images in my theme as shown below
<img src="<?php bloginfo ('stylesheet_directory');?>/images/blogo.png" />
It worked perfectly until I installed a Child Theme. I had to change
<?php bloginfo ('stylesheet_directory');?>
to
<?php bloginfo ('template_directory');?>
Before it started working again. Just need help understanding why that happened. Thanks
stylesheet_directory is the directory that contains the main stylesheet in use (so if you have a child template then it would be the child directory. If not, it will be the template directory.
template_directory is the directory of your parent theme.
Look at the codex for more details
Stylsheet directory links to the main stylesheet, and not the child theme( since the child theme may not contain the style.css by default, it inherits the style.css of parent theme. So the parent path is called if you are using this).
So always use get_stylesheet_uri() or get_template_directory_uri() for these purpose.
Hope this clarifies you.

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.

Wordpress Child Theme CSS Import

I am creating a Wordpress JigoShop Online Store. Having bought their Jigotheme, I have created a child theme and activated it (with Jigotheme as parent template).
I tried to import the styles from the jigotheme using:
#import url("../jigotheme/style.css");
(as per wordpress instructions)
The stylesheet is not pulling in - child theme works fine aside from this CSS import issue.
I know that no code can be above the #import code in the stylesheet - but would it not be working because the parent style.css also has #import code at the top of it? Are they conflicting perhaps?
Any help would be really appreciated!
You could just add an other <link>element to the head or enqueue it.
The import statement should work. Double check the directory path and .css filename. If you're using Chrome, you can check the network tab to see if the parent style.css is actually being accessed.
Follow few steps:
Replace bloginfo('template_directory'); ?> with php bloginfo('stylesheet_directory'); ?> (Credit goes to #WouterB)
Check if your parent theme using stylesheet which is located under sub-folder (eg. theme/css/style.css), in this case you have to place your child theme css under that folder.
Remember to change path (may be you have to ../ before previous url)

Wordpress Child-Theme CSS not Reflecting on Site

I've semi-successfully created a wordpress child-theme. By successfully I mean:
I managed to create a child-theme directory in my themes folder, next
to my main theme
I created a style.css file in the child-theme dir
I saw the style show up on my Wordpress back-end and managed to activate it
I added templates (header.php, sidebar.php,...) to the directory
I made changes to the above templates and saw the changes on my site
However, there is one huge problem:
Whatever CSS I try to add to the style.css file, it's not affecting the site
I know the "information header" must be ok since I was able to see/activate the child-theme. But I really can't figure out what is wrong. I tried removing the #import rule, which according to the Wordpress codex should remove all styles from my site - nothing happened.
I'm using the Panorama theme and created "panorama-technology" as a child. Below you can see the code I have in the style.css file inside the child-theme: "panorama-technology":
/*
Theme Name: panorama-technology
Template: panorama
*/
#import url("../panorama/style.css");
#search{
margin: 15px 15px 0 0;
}
WouterB, I had the same problem with my child theme loading in the backend, and child php pages overriding the parent theme php pages, but NO child CSS changes loading to override the parent styles.
So,although with different coding, it turns out my parent theme was written in such a way that the header was also looking for the stylesheet in the template directory, so your solution was spot on in concept.
Thus, by changing the call in the header from :
<link rel="stylesheet" type="text/css"
href="<?php echo get_template_directory_uri();?>/style.css" />
to:
<link rel="stylesheet" type="text/css"
href="<?php echo get_stylesheet_directory_uri();?>/style.css" />
--did the trick like magic. At least as far as I can tell so far.
You get major credit in my book!
First I'd try an absolute path to be sure that the path isn't the problem. If that does not solve the issue. Place the #import at the very top of the css file or directly after thelast "*/". I think white space is probably the culprit here.
Do not use import.
Add time after css uri for refreshing everytime.
In your function.php
function child_style() {
wp_enqueue_style( 'parent-child', get_stylesheet_uri().'?'.time());
}
add_action( 'wp_enqueue_scripts', 'child_style', 20 );
Watch out from caching :
wp cache plug-ins
server side cache (APC etc.)
local browser cache

Resources