Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

A safe way to add/enqueue a CSS style file to the wordpress generated page. If it was first registered with wp_register_style() it can now be added using its handle.

3
votes
2answers
32 views

Why my CSS file is not being registered in functions.php?

I want to enqueue the stylesheet in functions.php, but it's not loading. What can be problem in my code? function my_theme_sty() { wp_enqueue_style( 'bootstrap', get_template_directory_uri().'/...
0
votes
1answer
27 views

CSS getting injected into index from somewhere after theme/custom CSS is loaded, overriding all of my CSS

Using the inspector tool i can see that some CSS is getting injected/generated from somewhere (which i don't know where) which is overriding my own css. I've tried several things from using a child ...
4
votes
2answers
52 views

Removing specific style from wp_head

I'm not a WordPress developer, I'm trying to help a friend who has a WordPress website. Here is the problem: In the template, wp_head() function adds bunch of styles and scripts. I want to remove ...
0
votes
0answers
15 views

JQVMAP not working after proper wp_enqueue_script usage [closed]

So I worked at this for awhile and I found other people having problems with JQVMap. I'm not sure if there is some JQuery conflict, I did test registering a newer JQuery, but I'm not interested in ...
2
votes
1answer
20 views

Dequeue theme stylesheets but keep widget styling on custom page template

Bit of an unusual one. I have created a plugin that will only display content on a custom page template. For this reason, I have dequeued all the theme styles via $wp_styles and loaded in the plugin ...
1
vote
0answers
34 views

Font Awesome 5 Free - far working but fas is not? [closed]

This is making me crazy. I'm using Font Awesome 5 Free in custom list styles using :before and content: In every instance, far icons are working and fas icons are not. I've checked everything I ...
1
vote
2answers
29 views

CSS not affecting widget output

so I am still quite new to wordpress development so don't rage and I am sorry if I did something really stupid. So I am having trouble with my CSS, for some reason it's not affecting the widget ...
0
votes
2answers
45 views

How to change menu labels

What is the best approach to changing admin menu labels? As part of my first step in modifying the admin area, I would like to know how I can change WooCommerce label to Shop?
0
votes
2answers
21 views

Enqueueing styles with version variable

My version variable doesn't seem to be being applied within my enqueue functions (snippet below). //version number $version = '1.0.0'; function frontend_styles($version) { wp_enqueue_style( ...
0
votes
1answer
40 views

Using wp_add_inline_style Inside a Template File

I'm trying to figure out how to get wp_add_inline_style to work inside a template file. The code I'm using is this: function custom_css() { $output = '.some-class { background: #000; }'; ...
0
votes
1answer
22 views

Wordpress plugin enqueue scripts working for js, but not css files

I am trying to load custom css specifically relevant to the plugin. The js is working perfectly fine, but the css just refuses to get loaded in. Here is the code: function admin_plugin_scripts(){ ...
0
votes
1answer
22 views

Stylesheet is getting removed/deregistered automatically

I've put some custom code in my active child theme's functions.php. I'm trying to enqueue some style on a admin page. However, a style enqueued in admin_enqueue_scripts hook gets automatically removed ...
0
votes
1answer
47 views

enqueing Javascript and CSS

Whenever I check my website on gtmetric, google Insights, Pingdom etc... I always get feed back of render blocking JS Currently I enqueue all my scripts as so: <head> <link rel="...
0
votes
1answer
19 views

Edit CSS of a plugin

I'd like to edit a CSS file that is located at wp-content/plugins/woocommerce-gateway-stripe/assets/css/stripe-styles.css, I tried to overwrite it by placing the edited css in my child theme at wp-...
0
votes
1answer
86 views

How can I get this child theme stylesheet to properly load? Or if it is correct, why doesn't my child theme appearance match the parent?

I've read the Codex article on child themes, and numerous StackExchange Q&As, but I've not been able to get this figured out. The impact is that my child theme does not exhibit the same styling as ...
0
votes
3answers
71 views

Child theme .css files are not overriding their parent .css files

In the last month I have been creating my very first website. Before this I had no coding knowledge so everyhting I learnt was new to me. My problem over the last week is that my child theme .css ...
0
votes
0answers
15 views

How to load the style.css to my index.php?

I'm having a lot of trouble trying to add the style.css to a new WordPress theme I'm making (name "vik01"). I've tried different instructions, following some tutorials, but in the end nothing seems ...
0
votes
1answer
39 views

How to enqueue a theme style-sheet to my admin settings page?

I have a situation in which I am building a plugin that is intentionnally fit for a particular theme. Within my theme I have the following folder structure leading to my css file. wp-content -> ...
0
votes
1answer
17 views

Custom plugin - load enqueue only for this plugin

I have made my own plugin, which works fine, but I'm enqueueing (is that a word?) bootstrap, which then loads cross-site (admin). I found some workarounds, but the current workaround I'm trying throws ...
0
votes
3answers
35 views

What is the difference between the different ways of linking stylesheets

I'm only just learning WP theme development so this may be a very stupid question, but I have noticed there are different ways to link to the main stylesheet from the index.php: <?php bloginfo('...
0
votes
0answers
77 views

Child theme: wp_enqueue_style doesn't load parent style.css

I try to create a Portal child theme, as I did already for some other theme, but wp_enqueue_style method do not load the parent style.css. Here is what I did : I created a folder named portal-child ...
0
votes
1answer
163 views

Parent theme styles overriding child theme CSS [closed]

I am having some trouble getting my child theme to work perfectly. I have successfully created a child theme based on the Flexia theme. I have made child themes before but not come across this issue ...
-2
votes
2answers
43 views

How to create my own style.css file in an wordpress child-theme

I am working in the theme called Understrap. I work in the child-theme. The theme allready has a style.css and functions.php. I want to create my own style.css file and overwrite that style.css ...
0
votes
1answer
142 views

Relative path instead of absolute for wp_enqueue_script

When you enqueue scripts or styles with the following: function themeslug_enqueue_style() { wp_enqueue_style( 'core', '/style.css', false ); } add_action( 'wp_enqueue_scripts', '...
1
vote
2answers
32 views

How to remove scripts/style added to customize_controls_enqueue_scripts hook by current active theme

I am looking for a way to remove/unhook all assets (css and javascript) files added to customize_controls_enqueue_scripts hook when the query string mo-reset=true is added to the customize url.
0
votes
1answer
36 views

How can I move my custom css to the very bottom of the head section?

I have a code, which includes my custom css file to the of the template: add_action('wp_enqueue_scripts', 'add_custom_css'); function add_custom_css() { wp_enqueue_style('custom-styles', ...
1
vote
0answers
55 views

Custom style sheet won't enqueue / load if the css file actually exists. [closed]

The symptoms of my problem are different from other similar questions, on this forum and others. I'm using a local instance of WP, using the 33 theme, on XAMPP, and with a virtual domain, something ...
0
votes
0answers
43 views

Error importing Bootstrap with wp_register_style

I'm trying to import the Bootstrap library in my Wordpress website. I have downloaded it from the website and I have copied the files into the css folder inside my theme folder. Here is the code: ...
0
votes
1answer
71 views

I can't add CSS with functions.php [SOLVED]

I'm relatively new to creating a theme with WordPress, and I've been adding all the stylesheets (main and for each page) with the old echo get_stylesheet_uri();. But I find out that this isn't the ...
1
vote
2answers
49 views

Is it possible to enqueue CSS files from plugin before theme's CSS files?

If I enqueue styles from my plugin, then it loads after theme's styles. That's why some CSS of my plugin is overriding by theme's CSS. This problem would be fixed if I can ensure my plugin's styles ...
0
votes
1answer
95 views

The CSS (style.css) Of My Custom Theme Is Not Being Applied At All

I am creating my own theme Wordpress, however the CSS I wrote for the theme design is not being applied at all. It's saved in style.css and I have applied the following in my functions.php file: <...
2
votes
2answers
167 views

“wp_enqueue_style();” don't load new edited style

First, sorry my english. I am using Local by flywheel to manager my site files and my wordpress version is 4.9.4. Here is the problem, When I use wp_enqueue_style('wharever', get_stylesheet_uri()); ...
0
votes
2answers
115 views

Load custom CSS before admin CSS

I am trying to use the jQuery Datatables plugin in my WordPress dashboard but the native WordPress admin CSS styling is overiding the datatables CSS, I am calling them like this... add_action('...
-1
votes
1answer
91 views

How can I dequeue a Plugin Stylesheet?

I am currently using a Plugin, which has created a Stylesheet within the following directory: /wp-content/uploads/plugin-name/css. I would like to remove this Plugin's Stylesheet, since it is being ...
0
votes
1answer
120 views

How do I dequeue a Stylesheet, stored in an 'Assets' folder?

How do I dequeue a CSS Stylesheet located in wp-content > themes > theme-name > assets > css > theme-skin > color.css? The outputted code, within the Source Code, is: <link rel='...
0
votes
1answer
44 views

Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?

I am building a WordPress Theme, from the ground up. At present, I have placed a style.css file within the wp-content/themes/theme-name directory. The current information, within this file, is as ...
0
votes
1answer
273 views

How to insert html/css/javascript code to wordpress plugin

I'm trying to show a modal dialog when user get registered (action_hook: user_register) using the woocommerce plugin, but without having any result. I would appreciate any help! The code is shown ...
0
votes
1answer
23 views

my custom css file downloads then it STOPS!

I’m watching an online course for WordPress development and at the beginning I attached the css file the exact like what the instructor did and tested it by adding some styles and it worked fine ...
0
votes
1answer
78 views

Child theme stylesheet not always overriding “index”

I'm using a child theme and I'm using a "styles.css" file to override things from the parent theme. My styles (there are many stylesheets) are enqueued like this: function my_theme_enqueue_styles() { ...
0
votes
3answers
454 views

How to load different css file for different pages

I have several different pages. Every one of them has different css links. Rather than the css links all items are same in the head element of those pages. I need to shift those head element to header....
0
votes
1answer
39 views

Theme JS is available but theme CSS isn't

In functions.php I used the following code to enqueue assets, but for some reason all CSS is ignored (JS isn't ingonred): function my_theme_enqueue_assets() { wp_enqueue_style( 'parent-style', ...
0
votes
0answers
23 views

Why my css files is commented for front end user?

CSS file for logged out users: <!-- <link rel='stylesheet' id='cwpumpublic-css' href='http://localhost/bmekuet.org/wp-content/plugins/cwpum/public/css/cwpum-public.css?ver=1.0.0' type='text/...
1
vote
0answers
34 views

Additional CSS - crashing with javascript-html minifier?

How can I load Additional CSS style manually in functions.php? This is how I load my css files and js files: function xxx_scripts() { // Load our CSS bundle. wp_enqueue_style('xxx-master-...
1
vote
2answers
48 views

How the Css File is Linked without calling it in header.php?

everytime I analyze free wordpress.org theme, I am not able to find how the css file is linked in the theme. as far as i learned css file should be linked in header.php using link tag. but everytime I ...
0
votes
2answers
35 views

Enqueue style for specific site type

I want to import a style only on specific site types (articles (single.php), categories (category.php) and 404 page (404.php)). I tried to use is_page() but I don't know if it works for different site ...
1
vote
1answer
19 views

using conditionals on enqueue styles

I want to run my css code on a specific page in admin area. What is the best approach please? A: function register_style() { if (is_page..something) { wp_enqueue_style('style', ...
1
vote
1answer
20 views

Theme in wp-content but my index.php search theme files in root

My file is in i.e in domain.com/wp-content/Themename/css/cssfile.css But for example css files are looked in domain.com/css/cssfile How to change this? The site isn't loading anything properly ...
0
votes
2answers
631 views

Bootstrap navbar responsiveness on WordPress theme menu not working

The theme I am creating is not working correctly. The menu is not collapsing into mobile view with the hamburger icon when I decrease screen size. I can see all the classes when using the inspect tool ...
0
votes
2answers
66 views

Child Theme not loading multiple stylesheets

I have little experience with creating a Child Theme. Just want to make some changes to css on the website. When I use the inspect mode to see which CSS was being used, I saw it was still linking to ...
0
votes
1answer
230 views

Enqueue styles properly in a child theme and stylesheets location

I have inherited a site without a child theme and now we will have problems when it comes to update things. Everything in this theme was made on the main theme... I have now created a child theme but ...