A web style sheet is a form of separation of presentation and content for web design in which the markup (i.e., HTML or XHTML) of a webpage contains the page's semantic content and structure, but does not define its visual layout (style). Instead, the style is defined in an external style sheet file ...

learn more… | top users | synonyms

13
votes
3answers
2k 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 ...
7
votes
4answers
521 views

Do I actually need to link my theme's style.css in the theme files

So I am developing a wordpress theme using a series of LESS files for the CSS. These compile using codekit to a combined and minifed stylesheet that I use for the theme's styling. I understand a ...
6
votes
2answers
541 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
4answers
3k 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', ...
5
votes
7answers
8k 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
5k 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 ...
5
votes
1answer
4k 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 ...
5
votes
1answer
255 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
341 views

Enqueue Stylesheets After Theme's “rtl.css”

I am currently developing a theme with internationalization support, and would like to load stylesheets after my theme's rtl.css (an alternative style.css loaded for languages with a right-to-left ...
4
votes
3answers
1k views

How to add stylesheets only to pages with specific shortcode?

I'm running a function on pages where the shortcode [make-me-a-map] is used. It enqueues javascript to the page and makes a map. That part works fine (woot!) but I'm having trouble with adding the ...
4
votes
3answers
607 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 ...
4
votes
1answer
645 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 ...
4
votes
2answers
56 views

How to edit an existing WordPress theme? [closed]

I've been hired to modify/update/change an existing WordPress theme. The site is already live, and I'm wondering how to work on the theme locally first.
3
votes
2answers
279 views

Versioning @import of parent theme's style.css

Context I built a child theme based on Twenty Thirteen which works quite well. After updating the parent theme to version 1.3, I noticed strange behavior with the styling which was caused by a cached ...
3
votes
3answers
398 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
1answer
237 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 ...
3
votes
1answer
157 views

How to modify/extend/override a core method?

This is my first post. In advance, thank you for welcoming me... Context When you enqueue style, you can output your css link into conditional comments. global $wp_styles; ...
2
votes
3answers
7k 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 ...
2
votes
2answers
1k 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 ...
2
votes
1answer
5k views

adding custom stylesheet to wp-admin

im having troubles getting my custom stylesheet work on WP-ADMIN area. plugins_url('style.css', __FILE__) ); do i have to create folder in my plugins named css or do i just copy my .css to the ...
2
votes
1answer
3k 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
1answer
63 views

Overwrite CSS with without deleting it

I have some css in the theme that I am using, I want to keep the stock style.css without deleting any of it. I want to use my child-theme style.css to remove or hide some values of a class. I would ...
2
votes
2answers
1k 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
847 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
1answer
35 views

WordPress – site with 2 stylesheets and more…

I’m building a site that is broken up into two views (or sections): College and Corporate. » See it here When the College tab is active, the site will use college-styles.css (orange background) ...
2
votes
2answers
2k 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 ...
2
votes
1answer
125 views

Theme information in style.css being corrupted

I am customising someone else's theme to allow the website owner to edit more regions than she could previously. I copied the theme into a new folder, with a different folder name to the original. I ...
1
vote
4answers
348 views

Different background-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
3answers
154 views

Can I add styles to footer with $wp_styles->add_data?

I'm working on a script to easily move js and css scripts to the footer using the add_data function in $wp_scripts and $wp_styles. I know for scripts that if the group is greater than 0 the script ...
1
vote
1answer
327 views

Include print style sheet

How do I properly link a print style sheet? All my styles have been enqueued through functions file. The codex suggested I put the link in the header but this didn't work, is there a core print ...
1
vote
2answers
584 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
1answer
2k 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
3answers
183 views

To enqueue or not to enqueue

What is the best way to link to a CSS file in WordPress? Method 1: Use the following whenever needed <link href="<?php echo get_template_directory_uri(); ?>/my-style.css" rel="stylesheet" ...
1
vote
1answer
2k 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 ...
1
vote
2answers
263 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
2k 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
1answer
798 views

Enqueue styles after a plugin

Is there a way to enqueue my style.css (and other stylesheets) AFTER a certain plugin enqueues its styles? Specifically, I want my style.css to overwrite cforms's styles, but when I change the ...
1
vote
2answers
5k 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
711 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
851 views

Looking for methods to Check if File Exist

I'm working on a custom theme framework for educational purposes. I basically have a header.php in a child theme that i want to make smarter. I'd like to only include a stylesheet if the file ...
1
vote
1answer
42 views

Stylesheet comment header: Which header names are mandatory? [duplicate]

I've always used the same comment header names in my style.css document. Theme Name, Theme URI, Author etc. For example: /* Theme Name: Example Theme URI: http://example.com Author: John Doe Author ...
1
vote
1answer
94 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
142 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
422 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
254 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
646 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
113 views

Dynamic Stylesheet loads but doesn't finish

I am creating a website for an architect with large images being a main feature of the site. Given the potential size of the images I wanted to have a way to create responsive image sizing (and of ...
1
vote
3answers
454 views

Avoid to load default WP styles in login screen

Is there some way to avoid the load of default WordPress styles in login screen to only load my custom stylesheets? Actually I'm using this code: function login_styles() { // Sets the styles if ...
1
vote
1answer
182 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
1k views

W3 Total cache “empty all caches” and no stylesheets render [closed]

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 ...