The stylesheet tag has no wiki summary.
10
votes
3answers
1k views
How important is it to enqueue a theme's stylesheet?
I have trawled the net looking for an answer to this, but for some reason all I can find are actual examples, but without that particular explanation, which is clear say in the case of scripts. Can ...
6
votes
2answers
409 views
Style reply form different than comment form
Is there a way to display (css and html) in a different way the "reply" form and the main "comment" form?
5
votes
7answers
4k views
How can I version the main CSS file?
How can I instruct wordpress to use a filename other than 'styles.css' for my main stylesheet - for example, styles-1.css? I'd like to do this for versioning and caching purposes.
5
votes
2answers
3k views
Generating CSS Files Dynamically Using PHP Scripts?
As part of my efforts to speed up my themes for my clients I am delivering my CSS via a dynamic PHP file. At the end of the called for example my_theme_css.php:
This allows me to add Expiry headers ...
4
votes
1answer
136 views
How to enqueue style before style.css
How do I enqueue a .css file before style.css is loaded? Or make the default style.css dependant on another .css file?
I'm trying to load a .css reset, which style.css would overwrite.
Here's what I ...
4
votes
1answer
76 views
How to work with custom styles saved in theme option?
I am creating a theme where user can save custom styles from theme customizer through settings API. Those style info are saved in options table as serialized data.
When Custom skin is active I will ...
4
votes
1answer
133 views
Is it possible to bold certain words in a post title?
I guess I would like to be able to include HTML tags within the title so that when the title is listed certain words are bolded.
Is this possible? When I try to put HTML into the title, the tag ...
3
votes
4answers
1k views
Enqueue Google Web Fonts Without Messing Up Symbols In URL
Enqueuing Google Web Fonts the usual way, i.e., using the wp_enqueue_style function like so...
function wpse_google_webfonts() {
wp_enqueue_style( 'google-webfonts', ...
3
votes
2answers
569 views
When enqueing a stylesheet, is it possible to remove the type attribute?
I'm updating my self-built theme to HTML5, and easily made a number of changes already.
My theme's sole stylesheet is added to the page head via wp_enqueue_style in the functions.php file, as ...
3
votes
3answers
278 views
Stylesheet switching and caching
I'm implementing a site that allows users to switch stylesheets (to show a high contrast version for people with vision impairments). The switcher essentially just changes the <link>ref to ...
3
votes
3answers
134 views
How can I reduce the amount of files loaded/included per plugin?
I have a Wordpress site that uses several plugins, namely 8. Most of these plugins include a lot of their own JS and CSS files, some even include so much as 3 separate CSS files. One can imagine that ...
3
votes
1answer
153 views
TinyMCE custom stylesheets for different post types
I use a custom stylesheet for TinyMCE, by placing custom styles in editor-style.css in my theme's directory.
I am trying to figure out how to use a different stylesheet depending on what post type we ...
2
votes
2answers
2k views
wp_enqueue_style built in styles
I'm writing (rewriting) my plugin to use
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-dialog');
Which is great!
But to use the dialog I need to load a jquery style sheet with ...
2
votes
2answers
319 views
How to implement different color schemes in your themes
This question is for theme developers.
I know how to use the settings API to gather input data, but I was wondering what's the best way include the styles.
Let's say you have 4-5 versions of the ...
2
votes
2answers
600 views
add generated stylesheet from parent theme after child-themes style.css
I have a child-theme -> parent-theme setup, where I need to have stylesheet called generated.css loaded in addition to the style.css file added by the active child-theme. The generated.css file is ...
2
votes
2answers
503 views
how to make stylesheet appear in theme editor?
I have a stylesheet in my theme in the css subdir of the theme dir (css/style.css). The question is how to make this .css file appear in the theme editor of the WordPress admin. (I know using the web ...
1
vote
4answers
85 views
Different backgroundg-image by category
I am trying to put different body background-image for each category.
body {
background-color: #000;
background-image: url(img/bg.png);
background-repeat: no-repeat;
background-position: center ...
1
vote
1answer
1k views
Changing permalink changes stylesheet path?
I have changed my permalink structure to /%category%/%postname%/.The links are working, but the problem is that my style.css is not working in some of the posts which are inside the category.
1
vote
2answers
62 views
Do I have to use a Wordpress specific CSS reset, or is a normal, Eric Meyer style CSS reset fine?
The great starter theme _S for Wordpress has the following CSS reset included, which works pretty well I find: https://gist.github.com/4173728
But I prefer the Eric Meyer one, which I'm sure you're ...
1
vote
2answers
180 views
getting url in wp_enqueue_style
I'm having trouble getting the second argument in wp_enque_style. Here's how my site is setup:
style.css
custom_style.css
index.php
In a template, I have this code:
$stylesheet_url = ...
1
vote
3answers
1k views
Can't edit style.css in subdirectory of my theme?
I want to edit a file style.css but the theme editor shows this:
/* ---------- Reset Tags ----------- */
@import url("css/reset.css");
/* ---------- Reset Tags ----------- */
@import ...
1
vote
2answers
3k views
Specific css on homepage, different one for other pages
Is there a way to have specific css on the homepage and use a different one for all the other pages?
1
vote
2answers
357 views
What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?
I have written a basic gallery plugin that uses wp_enqueue_style to include a stylesheet on the page. I'd like for the WordPress theme to be able to override the style of the plugin which means I'd ...
1
vote
1answer
22 views
Add a custom stylesheet for BlackBerry
I want a little help loading a custom stylesheet in wordpress. I'm using PHP to check if the user agent is BlackBerry. If yes, I want to load blackberry.css, if no, regular wordpress style.css.
...
1
vote
2answers
87 views
Hiding styles from Facebook
Some of my pages/posts have very short custom stylesheets at the beginning of them. I know this isn't great practice, but it's worked very well thus far. The problem, however, is linking on Facebook: ...
1
vote
2answers
100 views
Child Theme vs. Jetpack Editor
I have read that it is always desirable to create a "child theme" so that any changes I make don't get washed away if the main theme is updated.
However, one of Jetpack's features is a CSS editor ...
1
vote
1answer
152 views
Changing stylesheet depending on custom taxonomy terms
My client would like the background & header colors to switch
depending on terms within the custom taxonomy 'Grades'. These terms
are kindergarten, first grade, second grade, etc... (all ...
1
vote
1answer
383 views
Wordpress override bloginfo variable
How would I override a bloginfo variable in wordpress?
For example, I want to replace this:
<?php bloginfo('stylesheet_directory'); ?>
to return a custom URL like http://mysites.com/hello/
1
vote
1answer
36 views
Add CSS to head depending on nav menu walker
I have a custom walker for a navigation menu on my website, and within it I have some custom CSS that I want to apply to each menu, however, I cannot simply echo it there because even though it works ...
1
vote
1answer
189 views
W3 Total cache “empty all caches” and no stylesheets render
I have the w3 Total cache plugin installed and so far its been great as I'm sure you will all agree, so thanks to the author for an amazing plugin. However, I used the "empty all caches" button on the ...
1
vote
1answer
243 views
Deregister default wp-admin css on login screen only?
I have a question about deregistering 'wp-admin' styles specifically on the login screen.
If I just globally run:
<?php wp_deregister_style( 'wp-admin' ); ?>
my login screen will have no ...
1
vote
1answer
177 views
Admin Panel pagination link styles
Whenever I write plugins that use Admin Panels, I include some form of pagination using the paginate_links method and I have always been able to style them in a nice way using the suggestions on this ...
1
vote
1answer
249 views
How to override my plugin's php classes with duplicates that are in my child theme folder
I have a child theme in wordpress and one of the plugins I am using is called jigoshop.
I made a copy of a few php classes from the plugin and placed them in my child theme folder. I want these ...
1
vote
1answer
137 views
How to load parent theme style.css?
My WordPress site uses a theme that is a child of a parent theme. As required, both themes have style.css files. However, as far as I can tell WordPress only provides the mechanism to load the child ...
1
vote
1answer
404 views
Loading different stylesheet on Wordpress pages?
I have one stylesheet linked to my Wordpress page in header section:
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" />
Now, I want to ...
1
vote
1answer
74 views
Remove Wordpress Scripts
I am working on a custom page template in my theme, i want to remove all other styles and scripts which are loaded, like default theme style, jquery & other scripts, i want to remove all for the ...
1
vote
1answer
468 views
Dynamically add CSS to the visual editor
I created an options page for my theme, where I can manually edit the CSS.
Lets say I change the CSS in the options page for the <H1> tag, so it will now change it on the front-end.
What I want ...
1
vote
1answer
47 views
using advanced custom field to control css hover color
this is a bit challenging for me:
I am using the great Advanced Custom Field plugin on my site to create different color scheme to each of my taxonomy.
I created a field called taxonomy_color and ...
1
vote
0answers
182 views
Using PHP to toggle stylesheet and header image, set in cookie
I haven't done a lot of work with cookies or Wordpress before so I think I've been a bit over-optimistic in my quest :p I have created two themes for my site, night and day. I would like the user to ...
1
vote
1answer
163 views
Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
Possible Duplicate:
How can I use WordPress functions in my stylesheet?
I have a file, custom.php, thats basically a stylesheet with php variables for the styles. I used this guide to make ...
1
vote
1answer
123 views
Style category link depending on category ID
I want to style a link depending on its ID, for instance, if the category ID is 2, then I want the link to be pink. My theme calls the category like this:
<?php if (in_array('categories', ...
1
vote
1answer
302 views
How do I register a stylesheet inside a WordPress widget?
I'm developing a WordPress widget following Dave Clements tutorial. It works well. Now I want to add some styles to it. I want the styles to be in an extra css file which will be loaded during ...
0
votes
3answers
573 views
Correct way to include extra styles & script files?
I'm just wondering what is the correct way to do it? Add it in via the theme header? If so, what is the proper way to do it? I see a lot of the other current stuff in there using the bloginfo() ...
0
votes
3answers
43 views
Code working just in specific time period
I have this code in my style.css
iframe[src*="http://www.youtube.com/"]
{width:480px !important; height:305px !important;padding-top: 20px;display:none}
as you can see, it makes youtube videos not ...
0
votes
3answers
2k views
how do I queue my Child stylesheet/s *after* every Parent stylesheet/statement?
I'm using the well-written Oenology theme by Chip Bennett as the Parent to my own Child theme.
In my development process, I've discovered that there are some challenges for people writing Child ...
0
votes
1answer
555 views
what could cause get_stylesheet_directory_uri() to fail?
On my new worpress install, I have code that reads
<img src="<?php get_stylesheet_directory_uri(); ?>/images/logo.jpg" />
This code worked, untill I started using a subdomain (went ...
0
votes
3answers
82 views
Exclude stylesheet from admin
I have been using the following function to enqueue some CSS to my theme. However, they are used in the admin area as well:
wp_enqueue_style(...)
I don't want them to be used in the admin area. ...
0
votes
2answers
52 views
Hook 'wp_enqueue_scripts' priority has no effect
In a theme I am working there are up to 3 Stylesheets. I am using the hook 'wp_enqueue_scripts'. The order of the stylesheets is important for overwriting styles.
I have a code like this:
...
0
votes
2answers
208 views
different way to achive stylesheet_url
I'd like to understand the difference between:
<?php bloginfo( 'stylesheet_url' ); ?>
and
<?php bloginfo('template_url'); ?>/style.css
because I think the second one is more flexible ...
0
votes
1answer
303 views
bloginfo('stylesheet_directory') vs. get_stylesheet_directory_uri() and include('file.php') vs. get_template_part()
In my custom theme I'm using <img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.jpg"/> to load my custom logo.
I'm using a custom sidebar for front-page.php and that's why I ...