41 votes
Accepted

Where are Additional CSS files stored

It's stored in the database, within the wp_posts table, under the custom_css post type, where the post name is the theme slug. There you also have the related customize_changeset and revision post ...
birgire's user avatar
  • 67.1k
39 votes

How to add custom css file in theme?

Using @import in WordPress for adding custom css is no longer the best practice, yet you can do it with that method. the best practice is using the function wp_enqueue_style() in functions.php. ...
Fil Joseph's user avatar
31 votes
Accepted

How to add crossorigin and integrity to wp_register_style? (Font Awesome 5)

style_loader_tag style_loader_tag is an official WordPress API, see the documentation: https://developer.wordpress.org/reference/hooks/style_loader_tag/ apply_filters( 'style_loader_tag', $html, $...
Remzi Cavdar's user avatar
  • 1,176
27 votes
Accepted

How to add CSS class to custom logo?

WordPress provide a filter hook to custom logo customization. The hook get_custom_logo is the filter. To change logo class, this code may help you. add_filter( 'get_custom_logo', 'change_logo_class' )...
Dhinju Divakaran's user avatar
21 votes
Accepted

How can I get a list of all enqueued scripts and styles?

do_action doesn't quite work like that. When you call do_action('crunchify_print_scripts_styles') WP looks at its list of registered actions and filters for any that are attached to a hook called ...
Andy Macaulay-Brook's user avatar
20 votes

how to add version of style.css in wordpress

If you are a theme developer, you might want to force reload of your assets when you push new version. So versioning of a theme is done in style.css /* Theme Name: Your Theme Name Version: ...
Milan Švehla's user avatar
19 votes
Accepted

How to change version of .css in WordPress?

The fourth argument, $ver for wp_enqueue_style() allows you to set the version: wp_enqueue_style( string $handle, string $src = false, array $deps = array(), ...
Dave Romsey's user avatar
  • 17.7k
17 votes

How can I get a list of all enqueued scripts and styles?

You could use wp_print_scripts and wp_print_styles actions to timely and properly access to enqueued scripts and styles, as these actions are the last events before scripts and styles are included in ...
cybmeta's user avatar
  • 20.5k
15 votes

adding custom stylesheet to wp-admin

If you want to make CSS changes for the admin panel. paste the below code in functions.php of your child theme add_action('admin_head', 'my_custom_fonts'); // admin_head is a hook my_custom_fonts is ...
Mohammed Muzammil's user avatar
15 votes

How to add CSS class to custom logo?

Here's one suggestion how we might try to add classes through the wp_get_attachment_image_attributes filter (untested): add_filter( 'wp_get_attachment_image_attributes', function( $attr ) { if( ...
birgire's user avatar
  • 67.1k
15 votes

Disable SSL / HTTPS for wordpress

Check your wp-config.php file for lines like: define( 'WP_SITEURL', 'https://example.com' ); define( 'WP_HOME', 'https://example.com' ); Also check your database's {prefix}_options table: SELECT ...
Pat J's user avatar
  • 11.8k
14 votes

how to add version of style.css in wordpress

Instead of hardwiring the version, you might find it better in some instances to dynamically version your stylesheet so whenever you change it, it automatically changes and refreshes the browser cache ...
Codeaholic's user avatar
14 votes
Accepted

Custom CSS In Admin Only For Certain Roles

Upon request I will write an answer using a function from a suggested answer for the similar question: How to target with css, admin elements according to user role level?. This function will output ...
JHoffmann's user avatar
  • 1,830
13 votes
Accepted

How to load scripts/styles specific for a page

It all depends on the scale of your customizations and how you will organize your stuff. But there is 2 main ways of doing it. functions.php and template files The way I like to do it, is register ...
bynicolas's user avatar
  • 2,279
13 votes

Where are Additional CSS files stored

type this into the sql query if your new like me, and it should come up. SELECT * FROM wp_posts WHERE post_type = 'custom_css'
Yandri Sanchez's user avatar
12 votes

How to add a custom CSS class to core blocks in Gutenberg editor?

You have second and third arguments with this hook you can use the second to get the block type. https://wordpress.org/gutenberg/handbook/extensibility/extending-blocks/ A filter that applies to ...
Shibi's user avatar
  • 1,813
10 votes
Accepted

Why are my frontend theme styles bleeding into the backend?

You're supposed to enqueue on the wp_enqueue_scripts event. Placing the function in functions.php and immediately running it, will make it run on all pages, including the admin area Here's an example ...
Tom J Nowell's user avatar
  • 59.2k
10 votes
Accepted

show classes as dropdown in guttenberg`s additional css classes input box

You should add a custom plugin. That needs a PHP main file that includes and registers a JavaScript file. The source below should result in a plugin. You will find a usable solution also in the probs ...
bueltge's user avatar
  • 17.1k
9 votes

Forcing reload of editor-style.css

I couldn't get toscho's answer to work for the current version of WordPress (4.7.2), and that seems to be because the TinyMCE init array has a cache_suffix set to 'wp-mce-' . $tinymce_version. So ...
icecold_3000's user avatar
9 votes

Give priority to child theme stylesheet

Perhaps you can try adding a priority value to each add_action to make sure that one executes before the other. add_action( 'wp_enqueue_scripts', 'fruitful_load_parent_stylesheets', 10 ); add_action('...
goalsquid's user avatar
9 votes

Remove wp_add_inline_style

Remove styles added with wp_add_inline_style() If we want to keep the custom-style-css but only remove the custom-style-inline-css, then we can try e.g. add_action( 'wp_print_styles', function() { ...
birgire's user avatar
  • 67.1k
9 votes

How to change version of .css in WordPress?

Mostly theme's use wp_enqueue_style() function inside their functions.php file to add style sheet in the header. Here is how to find out if your theme does the same. Open your wp-content/themes/...
Waqas Jawed's user avatar
8 votes
Accepted

Why is style.css not being enqueued?

The recommended way to do it is by enqueue-ing style.css in the functions.php of the theme. Add this to functions.php /** * Load CSS and JS the right way */ function myprefix_load_css_and_js() { ...
Arun Basil Lal's user avatar
8 votes
Accepted

Editing the custom background CSS

Yes, that is possible. Take a look at the codex and you will see that you can pass arguments with add_theme_support( 'custom-background'). One of them is the callback function that generates the <...
cjbj's user avatar
  • 14.5k
8 votes

How to add CSS class to custom logo?

As you found yourself the_custom_logo relies on get_custom_logo, which itself calls wp_get_attachment_image to add the custom-logo class. The latter function has a filter, ...
cjbj's user avatar
  • 14.5k
8 votes

Is there a quick way to remove inline css from all posts?

There are a few ways I can think of to handle this: Do it once for all current posts Do it at runtime before displaying posts (either by filtering the_content, or with jQuery) Do it with important! ...
Tim Malone's user avatar
  • 4,734
8 votes
Accepted

What is the meaning of WordPress's recommended css classes and where are they applied?

These classes are generated by WordPress. For instance, if a user inserts an image in his post and says it must be aligned right, WP will generate code like this in the post: <img class="...
cjbj's user avatar
  • 14.5k
8 votes

Dequeue classic-themes.min.css

Thanks to @t31os I achieved dequeuing the stylesheet with this code: function disable_classic_theme_styles() { wp_deregister_style('classic-theme-styles'); wp_dequeue_style('classic-theme-...
emot1onz's user avatar
  • 141
7 votes

Disable SSL / HTTPS for wordpress

You can modify .htaccess file: RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
user113337's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible