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

Questions tagged [wp-enqueue-style]

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.

0
votes
0answers
21 views

How to remove Google fonts from wp-admin (Roboto) added by core

This line is in source of /wp-admin/ code. I do not wish to have extra Google fonts in Wordpress admin area. <link rel='stylesheet' id='prefix-style-css' href='https://fonts.googleapis.com/css?...
0
votes
2answers
40 views

How should I identify the inline javascript that is the dependent of a wp_enqueue_script?

I want to run my own JavaScript on a specific WordPress page but only after a third party's plugin runs as I am trying to slightly modify that plugin. My problem is that my JavaScript is running ...
4
votes
1answer
288 views

Get the list of enqueued/registered scripts for a specific post?

I am exploring how to build a theme where most of the pages are loaded using the Rest API. I can load the index page and from there make GET requests to get posts json data and after build its content ...
0
votes
1answer
19 views

how to load css and js based on post template

I have created a post having the following template: <?php /* Template Name: Html Code Template Post Type: post, page */ ?> <?php get_header(); ?> <?php get_sidebar(); ?> <div id=...
0
votes
0answers
20 views

Plugins cant locate its own files, big path mess

This is my last resort to ask for help from you'all. I have a problem with a few plugins installed. They can't locate there own js/CSS file and that's a big problem. Iv checked the console for errors ...
0
votes
3answers
63 views

How do I create a child theme from PowerMag theme

I am using PowerMag 2.5 as parent and can't seem to find a way to get a working child theme. As far as I am now, I can only extend css in the style.css but as far as overriding, nothing has worked. ...
0
votes
1answer
13 views

Font size decreases when child theme is created from parent theme?

While creating and activating the child theme, the font size decreases as compared to parent theme <?php function my_theme_enqueue_styles() { $parent_style = 'spicepress-style'; // This is '...
6
votes
2answers
248 views

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

I am upgrading Font Awesome 4 to version 5 which introduces both integrity and crossorigin attributes to the <link rel="stylesheet"> markup. Currently, I am using: wp_register_style('...
0
votes
1answer
23 views

Stylesheet Enqueue Order and Best Practices

i would like to do the following: customize a theme to my likings for use on several sites and installations. so i can make "global" changes (via own plugin?) then i would like to have a site ...
1
vote
1answer
251 views

Override load-styles.php with admin screen css

I am trying to modify css. I tried to modify the css with below code but does seems to work. if i try to change the color it works. #poststuff #post-body.columns-2 { margin-right: 300px; ...
0
votes
1answer
21 views

Page Templates not using functions.php

I am having an issue with page templates in Wordpress. I have created some for my website but they are not using the wp_enqueue_style in my functions.php. anybody know why this is? mainly my ...
0
votes
1answer
18 views

Adding styles/scripts to specific page

I'm trying to add styles and scripts to specific template, But it's not working. In functions.php I tried: if( is_page_template('file.php') ){} if( is_page_template( get_template_directory() . 'file....
0
votes
0answers
24 views

enqueue style using admin-ajax.php

Actually I’m making a generic personnal template with customization from the backend; something like in the premium themes. So I made a “theme apearance options page” with ACF. I added fields like “...
0
votes
3answers
105 views

Apply function only if end of url has /amp/

I applied a filter to remove all theme styles, but I want this to happen only if the url ends with /amp/. The code below is removing the .css styles on all pages, not filtering the term /amp/ of the ...
4
votes
2answers
64 views

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

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
58 views

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

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 ...
5
votes
2answers
212 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 ...
2
votes
1answer
27 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
356 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
30 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
216 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
23 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
97 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
27 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
23 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
100 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
31 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
164 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 ...
1
vote
3answers
121 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
16 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
80 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
22 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
56 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
211 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
253 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
46 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
228 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
45 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
48 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
199 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
67 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
135 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
120 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
199 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
226 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
238 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
449 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
162 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
126 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
514 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 ...