Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics (the look and formatting) of HTML output, usually via Themes. When you have to use this tag, then there's a high chance that your question is off topic on this SE network site.

learn more… | top users | synonyms

17
votes
2answers
548 views

Is it ever okay to include inline CSS in plugins?

Normally in a plugin I would add styles using wp_enqueue_style. However, I am currently creating a plugin that only needs a few lines of CSS and I am wondering if it might be better to serve the ...
17
votes
5answers
9k views

What are the standard admin CSS id/class tags?

Is there a list of WordPress CSS id/classes that i can use to build plugin option screens that look and feel more like a normal WordPress option page? i have found some through serendipity but it ...
15
votes
4answers
2k views

Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?

WP has a nice javascript loader included in wp-admin: http://core.trac.wordpress.org/browser/tags/3.0.4/wp-admin/load-scripts.php and a CSS loader: ...
14
votes
5answers
11k views

best way to overide plugin CSS?

currently, I use CSS specificity to override plugin styles. I prefer this to editing the plugin as it makes for less headaches when you update. What would be nice is if my style sheet loaded after ...
13
votes
4answers
8k views

How do I add CSS options to my plugin without using inline styles?

I recently released a plugin, WP Coda Slider, that uses shortcodes to add a jQuery slider to any post or page. I am adding an options page in the next version and I would like to include some CSS ...
13
votes
7answers
13k views

How do you avoid caching during development?

Is there a simple way do prevent all caching when testing the appearance of changes to the site? I use WP Super Cache. I can delete its cache using the option provided, delete the cache for my ...
12
votes
3answers
2k views

Customizing a WordPress theme without changing it?

I have found and downloaded a theme. However I want to tweak the CSS some to change the design, colours etc. a bit. How should I go about doing this, while still being able to update the theme without ...
11
votes
1answer
2k views

How can I use WordPress functions in my stylesheet?

I have my style.php file looking like this. <?php header('Content-Type: text/css');?> #div{ background:<?php echo get_option('bgcolor');?>; } This does not work, but when I do ...
10
votes
9answers
5k views

Adding first / last CSS classes to menus

is that possible, without javascript hacks? like this: <ul class="my_menu"> <li class="first"> ... </li> <li> ... </li> <li> ... </li> <li ...
10
votes
4answers
4k views

Solutions for generating dynamic javascript / CSS

Let's say you need to generate javascript or CSS code that depends on the current context. For example you have a form on the homepage that fires an ajax request on submit, and a different form on ...
10
votes
2answers
2k views

How to add sub-menu to a menu generated by wp_nav_menu by using plugin

I have a menu generated by wp_nav_menu which look like <ul class="nav-menu" id="menu-top-nav"> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-43" ...
9
votes
4answers
190 views

This CSS Stuffing Works, But Is This A Good Practice?

I am trying to include a dynamic css in my plugin, I have been searching anywhere but doesn't find any case that is similar to what I do. And what I use to do it is by adding a css file directly into ...
8
votes
4answers
5k views

Remove Open Sans from Twenty Twelve theme

I´m creating a child theme for Twenty Twelve v1.0 and I want to remove the Open Sans font. Open Sans is added in Twenty Twelve´s functions.php: wp_enqueue_style( 'twentytwelve-fonts', ...
7
votes
3answers
2k views

CSS classes for theme

Does anybody know predefined (suggested by WP) CSS classes which should I use in my theme? I have seen somewhere in Internet a list of all CSS classes, which are used in WP theme, but can't find it. ...
7
votes
3answers
398 views

How can I target WordPress 3.8 new interface MP6 with CSS?

When MP6 was a plugin in WordPress 3.6+ it changes the body class of the admin and added an "admin-mp6" class which helps me to style my plugin accordingly. Now with the latest Alpha of WordPress 3.8 ...
7
votes
1answer
3k views

Restricting a Plugin to Only Load its CSS and JS on Selected Pages?

I'd like to cause a plugin to restrict its loading of CSS stylesheets and JavaScript JS files to only those pages for which they are needed. An example for my question is the plugin Contact Form 7 ...
7
votes
1answer
3k views

wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i'm confused

I've been reading up a bit on this subject, but the more I read - the more confused I get. Can someone explain to me in short what's the exact difference between wp_enqueue_scripts, ...
7
votes
1answer
585 views

Assign a Class to the Current “Tag” for Formatting

Essentially what I am hoping to replicate is something like the "current-menu-item" class that is applied to WP Menus. My client is wanting to use Tags as a sub-nav, and I've managed to get the tags ...
6
votes
6answers
483 views

How can I test how fast or slow my wordpress website it?

I have my FIRST wordpress website and I love it, however I'm not sure if it's my browser (Firefox 8.0.1 for Mac) or my computer or the website itself but it's going really slow. MY SITE is in the ...
6
votes
2answers
6k views

How do I load a CSS style into WordPress admin area only?

I'm trying to load a CSS file for my WordPress post area, but having no luck. I have read over the wp_enqueue_style function and came up with the code below, but it doesn't load up. Is there a tag or ...
6
votes
5answers
466 views

How to Handle CSS Organization

I notice not many people have downloaded the plugin Combine CSS. Without it, I don't know of a better way to automatically combine CSS files. I was wondering, are 99% of the developers using ...
6
votes
1answer
1k views

Wordpress Admin Bar pushed Sticky Footer off the bottom of the page

I've implemented Ryan Fait's oh-so-common sticky footer in a custom Wordpress theme. I've noticed now if I implement the Wordpress Admin Bar into my pages, which is 28px high (in current Wordpress ...
5
votes
1answer
2k views

Enqueue a stylesheet for login page and make it appear in head element

I try to style the login page in my theme. Very simple: add_action( 'login_enqueue_scripts', function() { wp_enqueue_style( 'TEST', get_template_directory_uri() . '/css/login.css' ); }); ...
5
votes
2answers
3k views

How to add a “last” class to the last post in loop.php?

I need to add a "last" class to the last post that appears in loop.php. Can someone tell me how to accomplish this?
5
votes
6answers
2k views

Cache busting CSS files other than style.css

All right, so we're probably all familiar with the typical way to ensure that your main CSS file is refreshed when you load the page (busting the browser cache), right? <link rel="stylesheet" ...
5
votes
2answers
3k views

How to customize the default HTML for Wordpress Attachments

I'm using Wordpress 3.0.1 (most recent as of now) and working around the Whiteboard theme. It seems that for attachments (images, specifically), Wordpress generates the HTML automatically and it ...
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
2answers
950 views

Are the wordpress Core css styles really all nessasary?

On WordPress Codex there are this CSS styles listed, its a quite big list of styles but it seems they are doubled unnecessary. It says: Each Theme should have these or similar styles in its ...
5
votes
3answers
681 views

Splitting WordPress theme CSS into multiple files, good or bad?

I'm developing a WordPress theme framework. I want organize CSS for each section into separate files for the following reasons. Developers can easily deregister styles by parent theme and load their ...
5
votes
3answers
351 views

How to make a theme with more than one CSS file?

I've made my first theme and now I want to create different "profiles". These profiles are just independent CSS files that user can try. The point is, how to make these files to allow users to choose ...
4
votes
5answers
2k views

I want to remove top admin bar from wordpress. How to?

whenever admin or any other user logs in a top bar menu ads up. Now I made login for everybody, so I do not want this bar. first I added display:none to admin-bar.css, but the main problem is that ...
4
votes
2answers
2k views

Forcing reload of editor-style.css

Is there a method to force the refresh of editor-style.css, when I change manually the stylesheet for the TinyMCE editor? Modification doesn't show immediately but they will be cached in the admin ...
4
votes
2answers
375 views

Why I can't add a CSS style in this WordPress theme?

I am trying to add a CSS style to a WordPress theme that I am developing as is shown in this tutorial: http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/ ...
4
votes
1answer
847 views

Understanding wp_add_inline_style

I am trying to get my head round the wp_add_inline_style() function in WordPress. //setting inline css. function my_styles_method() { wp_enqueue_style( 'custom-style', ...
4
votes
1answer
1k views

Automatically decrease font size for long words

I am working on an e-commerce site in which post and product titles will need to be displayed in fairly narrow divs. I would like to set a specific font size for words which can naturally fit in the ...
4
votes
2answers
5k views

SSL Breaks Wordpress CSS

We purchased an SSL certificat from network solutions (would never recommend them to my worst enemy, btw). Apparently it's activated... did a few checks that says it's activated for our domain. But ...
4
votes
2answers
55 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.
4
votes
3answers
2k views

How to fix admin stylesheet muck-up? [closed]

I have no idea what's going on here.. running the latest version, just logged in and I find my admin area looking like this: To me it looks like it's missing some/many styles and in load-styles.php ...
3
votes
1answer
7k views

TinyMCE: adding CSS to format dropdown

I successfully added a TinyMCE stylesheet using add_editor_style() so that I can preview the styles in the body of the TinyMCE editor. However, am I right in assuming that the add_editor_style() ...
3
votes
2answers
221 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
1answer
529 views

Using tabs for wordpress plugin

Done my research and found this is how to call the built-in ui tabs jquery script in wp for the admin area but I'm stuck on implementing the other jquery scripts needed that I believe are built into ...
3
votes
2answers
204 views

Changing title to lowercase [closed]

Lets say i have 100 posts. And i would like to lowercase the title. but only 70 of it. I cant use text-transform or mb_strtolower. Is there anyway to download posts and lowercase the title with ...
3
votes
4answers
507 views

Suggestions for creative use of post format feature, or themes that use them well

I'm looking for themes or examples of sites that use the post format feature in an interesting way. I suppose adding special styling for each post format would be a good start. But if anyone knows ...
3
votes
4answers
4k views

Custom per-page sidebar widgets .. possible?

Let's say I'm doing a site about cars, and in the main content area of a Page (using a certain template), there are a few paragraphs about a particular car. In the sidebar, are several standard ...
3
votes
2answers
836 views

Modify CSS via Theme Control Panel

Hi to all I'm trying to create an advanced control panel for my first Wordpress template but I'm not able to add a function that I will need. The function that I'm trying to add is the possibility to ...
3
votes
2answers
113 views

Adding a class to the body_class function

Basically I've applied this way to show certain colors on pages like search.php or a list on home. What it does is it reads a variable that gets a field from WP, if that field is equal to a certain ...
3
votes
2answers
852 views

How to show Disqus comment count number only without text?

I'm using Disqus WordPress plugin. When the page is not fully loaded yet, there's only comment count but after that Disqus auto appends the string Comments to that which looks really ugly. From the ...
3
votes
1answer
431 views

How to apply a class to the second word in menu list item?

I want to apply a class to a word in my menu. For example, say I have a list item in my menu called "My Item". I would like to apply a class to the word "Item" so that I can style it anyway I want. ...
3
votes
1answer
258 views

Why max-width:97.5% on content images?

Is there a specific reason why we can find max-width:97.5% instead of 100% in common themes such as Twenty Eleven?
3
votes
2answers
546 views

Add a preview to a Wordpress Control Panel

I'm trying to create a new wordpress template and inside it I added a Control Panel, inside this control panel there is an option that allows user to choose where he want's to place a on a map, I try ...