Questions tagged [css]
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.
44
votes
5answers
44k 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 ...
36
votes
7answers
38k views
Best way to overide plugin CSS?
Currently, I use CSS specificity to override plugin styles. I prefer this for editing the plugin as it makes less headaches when you update.
It would be nice if my style sheet loaded after the ...
30
votes
9answers
55k 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 ...
28
votes
3answers
91k 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 ...
27
votes
4answers
3k 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:
http://core.trac.wordpress.org/browser/tags/3.0.4/...
25
votes
4answers
20k 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 ...
21
votes
2answers
906 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 ...
20
votes
3answers
33k 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() ...
20
votes
2answers
7k 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 this ...
19
votes
4answers
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 ...
16
votes
4answers
12k views
How to add CSS class to custom logo?
I enabled custom-logo for my theme and have it printed with <?php the_custom_logo(); ?> into the header. Is there any chance to simply add some more classes to this image directly? Per default ...
15
votes
4answers
9k 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', add_query_arg(...
14
votes
4answers
17k views
Style custom columns in admin panels (especially to adjust column cell widths)
I am using Wordpress as a CMS for a project which makes extensive use of custom post types. I need to display columns in admin panels for each custom post type in a different way.
I've already ...
13
votes
9answers
7k 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 class"...
13
votes
2answers
13k views
Where are Additional CSS files stored
This image shows the Additional CSS feature in Wordpress. I'm trying to find the file that stores the additional CSS, but can't seem to find it anywhere - I've searched almost every folder in wp-...
13
votes
5answers
8k 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 ...
12
votes
2answers
15k 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" id="menu-...
11
votes
4answers
48k 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 ...
11
votes
5answers
7k 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 ...
11
votes
2answers
19k views
Inbuilt style for jquery-ui-datepicker
I want to use the datepicker that gets bundled with WordPress on the front end of a website. I enqueued jquery-ui-datepicker but the datepicker isn't styled(no js error in console). Is there a ...
10
votes
1answer
5k 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' );
});
...
10
votes
9answers
75k views
How to add custom css file in theme?
Some themes ask you not to edit the style.css file, instead use custom.css file. If you write code on custom.css, it will overwrite the same element style in style.css. I think this is done in order ...
10
votes
3answers
38k 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 ...
10
votes
4answers
25k views
CSS not updating in browser when I change it
I am working on the CSS of my wordpress site. When I make changes and refresh the page the changes are not reflected. When I clear the browser history and cache the changes are still reflected. When I ...
10
votes
3answers
17k views
How to conditionally enqueue a stylesheet only for a certain page(s)?
Before I get started, I want to acknowledge that there are some really good articles that are targeted at how to conditionally enqueue scripts based on page/post content.
WordPress Plugin Development ...
9
votes
6answers
27k views
WordPress Admin Bar Overlapping Twitter Bootstrap Navigation [closed]
I am having an issue with the WordPress admin bar overlapping the Twitter Bootstrap (2.3.0) nav bar. I have tried this fix:
body.admin-bar .navbar-fixed-top {
top: 28px;
}
.navbar .brand {
...
9
votes
3answers
5k 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.
...
9
votes
4answers
245 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 ...
9
votes
1answer
19k 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 ...
9
votes
1answer
5k 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 ...
8
votes
4answers
21k views
How to change version of .css in WordPress?
Like the title suggests, I'm not too sure how to change the version of a .css file in my theme. At the moment the .css versioning is like this:
<link rel='stylesheet' id='xxxx' href='https://www....
8
votes
3answers
8k views
How to load scripts/styles specific for a page
I know that according default Wordpress boot process, firstly functions.php is called, after that goes all theme stuff.
But I am currently going to refactor my theme completely to optimize it.
My ...
8
votes
1answer
5k 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
15k views
How do I cleanly override a plugin's CSS with a child theme?
I have taken it upon myself to adhere to WordPress conventions so I can have a clean, sexy child theme. However, I am unsure how to proceed on a certain issue.
I would like to override the CSS for ...
7
votes
6answers
5k 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" type=...
7
votes
1answer
23k views
How do I add a search bar to my header?
I need to add a functioning search bar to my header. I have read through the forums but am unsure what code I need to put where. For instance, where do I put the css code versus where do I put the ...
7
votes
3answers
414 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
2k 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 ...
7
votes
1answer
783 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
7answers
585 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
3answers
22k views
Child themes CSS priority problems without using !important
I changed my WordPress site to use child themes, but the parent theme style has priority over any change I make on the child theme CSS. I can work around it using !important, however this is a patchy ...
6
votes
2answers
11k 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
2answers
5k 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?
6
votes
1answer
5k views
How to specify a class added to my gallery
I would like to add a class to my gallery short code, this is how I have added my class:
[gallery class="small" columns="2" ids="350,349,302,305"].
Now the confusion comes in, I am not sure how to ...
6
votes
3answers
13k views
Why is the Child Theme Stylesheet Not Loading?
I'm using the HashOne theme and created a child theme in order to make various color changes to our website.
However, the changes I've made to the child theme stylesheet are only taking place in the ...
6
votes
5answers
1k 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
2answers
32k views
Style something only on the home page
I am relatively new to Wordpress, but I'm sure there's a way to do what I'd like to do.
I have a container in my template, and on the home page I'd like to specify slightly different padding to this ...
6
votes
3answers
3k views
Are the WordPress Core CSS styles really all nessesary?
On WordPress Codex there are these CSS styles listed. It's 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 ...
6
votes
1answer
997 views
Is there a quick way to remove inline css from all posts?
I have 40 WordPress sites with 20-30 pages on each. Most of them have some inline css, like <p style="text-align: justify;"> in every single paragraph.
Is there a quick, mostly automated way to ...
6
votes
1answer
24k views
How to reference a theme image in a stylesheet?
I have a global element as part of my theme and I need to reference and image as a background image. I need the URL to the image. I assume that it's bad practice to hard-code the URL and that the URL ...