On Wordpress.org, I activated a BLANK theme by Chris Coyier.
I edit index.php and my changes are showing up on my website. Fantastic.
I edit the existing style.css file but none of my edits are showing up. Ugh.
I delete style.css and the website still works. Why?
I repeat these steps with a different blank theme. Same issues.
Questions
Why am I unable to edit style.css of ANY blank theme? I am confused because I am able to edit style.css of Twentyfourteen theme.
If I delete style.css from the blank theme, the website still works and still shows the same CSS styling. How is this possible?
For blank themes, the stylesheet is called in header.php as
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
But for Twentyfourteen theme, I don't see any call for a stylesheet.
Why do regular themes not have a call for a stylesheet in header.php? Is this why I cannot edit style.css of blank themes?
Most likely your browser is caching the CSS?
What happens when you use your browsers dev tools to check the CSS source.does that show your edits?
When you say "delete the CSS" do you get a missing resource error on the browser console?
If it does not, try force reloading your page.
Related
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/
I'm using Jetpack social sharing icons. If I enable them on Front Page, Archives, etc. they work almost everywhere (Search Results, Posts, etc.).
However, they break on Post Excerpts such as when listed in a post-loop on the Blog page. Each icon shows a square where the icon should be.
Any idea what's causing this?
See behavior here: [redacted]
Click a post to see icons as they should be.
It looks like the CSS for the genericons is not being loaded on the /blog page, but it is being loaded for an article. It looks like this in the HTML:
<link rel="stylesheet" id="genericons-css" href="http://newman.tamucc.edu/wp-content/plugins/jetpack/_inc/genericons/genericons/genericons.css?ver=3.1" type="text/css" media="all">
It's a little bit of a hack because I'm not sure how exactly Jetpack is loading it's styles, but you should be able to get the icons to load on every page by adding this line to the top of your functions.php file:
wp_enqueue_style( 'genericons', get_template_directory_uri() . '../../plugins/jetpack/_inc/genericons/genericons/genericons.css', array(), '3.1' );
I am trying to build a second .css file for my company's website.
Currently, we are using a responsive theme, so most of our content displays correctly on desktop and mobile browsers. However, recently the boss is requesting custom code that is unresponsive. In order to keep the site looking good, I want to apply a secondary stylesheet that contains formatting for mobile devices. It would be like this for any html page:
<link rel="stylesheet" href="http://domain.tld/mobile.css" type="text/css" media="handheld" />
I cannot figure out how to get this into a wordpress child theme correctly. Can anyone offer suggestions?
Thank you in advance.
Look for the header.php file in your child theme directory, or under "Appearance"->"Editor" in the main menu of the your Wordpress adminpanel. You can paste the link to your new stylesheet there.
Also consider moving the styles to your theme's directory and replacing the domain in your href with <?php echo get_stylesheet_directory_uri(); ?> (example from wordpress codex).
I have just followed a tutorial about creating custom WordPress theme, each and everything went just fine from static to dynamic conversion but when I activate that theme and I come up with a plain HTML document with blue hyperlinks which mean the site is not picking up the css file of style.css
Am I doing something wrong? Please help me.
Check your source HTML and see that the path to your CSS is correct.
You can use bloginfo() to find the correct path by using:
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style.css">
If your style.css resides in the root folder of your template.
Where did you add the link to the file? - View the source of the page to see if the link is there and try navigating to it to see if it returns a 404 (Not Found) or other error.
My preferred way to include theme stylesheets is adding something like this to my functions.php.
add_action('wp_enqueue_scripts','enqueue_my_styles_scripts');
function enqueue_my_styles_scripts() {
wp_enqueue_style('my-styles',get_stylesheet_directory_uri().'/style.css');
}
Check out wp_enqueue_style and make sure you have a wp_head() call in your header file
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