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.

Filter by
Sorted by
Tagged with
0
votes
3answers
31 views

wp enqueue style on about us page

On functions.php I have the following which works on the homepage : function load_page_styles() { if (is_front_page()) { wp_register_style('home', get_template_directory_uri() . '/css/...
0
votes
1answer
36 views

How to enqueue CSS and JS only on specific template?

I'm busy with my home.php template and I need a few CSS/JS files that are only loaded on that specific template. I tried doing it with if ( is_page_template( 'home.php' ) ) { //ENQUEUE CODE }, but ...
0
votes
0answers
14 views

How to reference different css (bootstrap) stylesheets for the header and body of a page?

Thanks in advance for the help, and apologies if I'm being dumb, I'm rather new. I have tried various different answers on this site, but they did not work, as they were meant for different pages. I ...
0
votes
0answers
21 views

Using bootstrap slider - importing css or js issue

I downloaded a html theme from here: https://colorlib.com/preview/?fbclid=IwAR0bCSqkNMgW4Sogyosq96bSqZFEI0yzjR_UcKXSCAhmPQKey795P7zkRkI#timezone I'm trying to make it work as a WP theme. I added all ...
0
votes
1answer
30 views

Theme style overrides the plugin style

Website theme overrides the plugin style, I'm using Cars4Rent child theme and chauffeur-booking-system plugin. I would like the original look and style of the booking plugin but the theme overrides ...
0
votes
0answers
33 views

How to wrap HTML comments around enqueued styles?

Is it possible to output HTML mark-up around enqueued stylesheets? I enqueue as follows... function enqueue_theme() { wp_enqueue_style('looper-default', get_stylesheet_directory_uri().'/looper/...
0
votes
1answer
23 views

How to enqueue multiple style sheets into my child theme in wordpress (oceanwp)

I would like to import several styles sheets in my child theme (oceanWP). I succeed to do it with "@import" method but not with enqueueing scripts and styles. My child theme uses this "style.css" : ...
1
vote
3answers
18 views

Stylesheet not linking

So I have the following structure in my theme: Themes/ - theme-name/ -- functions.php -- style.css -- page-directories.php For some reason, I'm unable to link the style.css to be included ...
1
vote
1answer
21 views

I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php

I'm working on converting a code template (html, css, js) into a Wordpress Theme. This wordpress theme is not a child theme. For the home page (front-page.php file) the enqueues of stylesheets and ...
0
votes
2answers
22 views

Browser stacks different versions of style.css

I am working with a child theme from 'Astra'. I am editing 'style.css' of my child theme for styling my website. I added this code to my child's functions.php' file to enqueue the father-child styles. ...
0
votes
0answers
24 views

Add inline CSS to login page with wp_add_inline_style

Trying to add inline style with wp_add_inline_style to login page by targeting login-css style sheet.. add_action( 'login_enqueue_scripts', 'bt_css_login', 1009 ); /** * Enqueue Login CSS * * @...
0
votes
0answers
25 views

Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying

My custom theme works well on my localhost, but when I upload it to my domain, it can not enqueue any of my styles and javascript. I have everything done correctly. wp_head & wp_footer installed, ...
0
votes
1answer
62 views

Wordpress wp_enqueue_style and wp_enqueue_script not working

I was following a wp theme developement tutorial but somehow my wp_enqueue_style and wp_enqueue_script not working here is my code functions.php <?php //Adding the css and js files function ...
0
votes
0answers
20 views

Test CDN link from function.php or wp_enqueue_script/style?

How can I check if CDN link is alive from function.php file on wp_enqueue section? E.g. I have jQuery CDN and I have downloaded jQuery on local. How can I test before mount theme (WordPress site) is ...
0
votes
0answers
53 views

Enqueue assets from multiple directories using add_action/do_action

I might not be using the actions correctly, but I think they work for my idea? Maybe? I'm trying to enqueue js and css from various directories based on do_actions. To simplify my setup and to make ...
1
vote
0answers
42 views

How to force that styles are enqueued in the header?

I have a plugin processing a shortcode, that needs specific styles. For this I used wp_enqueue_style. As I just need to enqueue the CSS upon certain parameters of the shortcode, I call ...
0
votes
0answers
15 views

CSS style and app.js not loading

I'm brand new at theme development. My directory is the following: I should see, in the page source (even if I have a blank page) the app.js loaded, but I don't. This is what I see: what is wrong in ...
0
votes
2answers
17 views

plugin css is not being applied to the page

I looked at this question: plugin css is not being applied to the page? but I couldnt solve my problem. I use below code like the question: <?php function libload() ...
0
votes
1answer
32 views

Stylesheet does not load despite functions.php

I am calling my stylesheet styles.css within functions.php. Also adding add_action. But it does not work… <?php function myBlog_files() { wp_enqueue_style('styles', get_stylesheet_uri()); } ...
0
votes
0answers
22 views

filemtime() warning when enqueuing style within plugin

I'm receiving the following filemtime() warning: Warning: filemtime(): stat failed for https://testing.local/wp-content/plugins/test-social-icons/css/style.css in /app/public/wp-content/...
0
votes
1answer
28 views

Plugin throws up 404 on front-end when when enqueuing style with filetime

I'm building a very simple plugin to add social media icons to each page on a site that I'm working on. I was expecting the following code to enqueue a stylesheet on the front-end: function ...
0
votes
1answer
31 views

Bootstrap Integtration

I wonder how can I integrate only bootstrap 4 grid system instead of : <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-...
0
votes
1answer
22 views

Stylesheets and scripts not loading

function spartans_styles(){ wp_enqueue_style( 'maincss', get_stylesheet_uri()); wp_enqueue_style('mybootstrap', get_template_directory_uri() . '/assets/css/mybootstrap.css'); ...
0
votes
1answer
736 views

Fatal error: Uncaught Error: Class 'WP_Block_Styles_Registry'

I am having some issues determining the solution to this problem below. The website was sent to our team to fix. Turned on error reporting in wp-config.php: define('WP_DEBUG', true); ...
-1
votes
2answers
34 views

How to only Load scripts on variable products page

I'm looking for a way to load my JavaScript and CSS only on the product page, but only if it's a Variable Products. The is_product() function works well, but my scripts are loaded for all types of ...
0
votes
1answer
21 views

Call a single function on two different methods with hooks

So I'm wanting to shorten my code down a bit and I would like some assistance.. How can I shorten the following methods into a single register method? They both have add_action which is a WordPress ...
0
votes
3answers
60 views

Enqueue custom css file on specific page

So I've been messing with this for a while now and I don't understand how I'm unable to pull in my style file properly by registering and calling it at all. Here is my method: public static function ...
0
votes
1answer
61 views

Bootstrap 4 Optimization

I installed all bootstrap links to my theme.I use bootstrap lowly; generally for grid system.How can I learn which link do I must install or not? Also I want to learn is my installation good or is ...
0
votes
1answer
54 views

Dequeue a style file which is making website load slow!

I have a website running on GrandNews WordPress Theme (https://themeforest.net/item/grand-news-news-magazine/15885465) and loading via KeyCDN. The site is loading a CSS file located at websitedomain....
0
votes
1answer
104 views

PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered

Can someone help me fix this error? PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, ...
0
votes
1answer
25 views

How do I dequeue js/css at the last possible moment?

I'm trying to dequeue the font-awesome stylesheet included with the ninja forms plugin (because I manually include the latest FA via a CDN). I did this: add_action('wp_enqueue_scripts', function () {...
1
vote
2answers
65 views

Child theme style.css versioning

I've been breaking my head on this one. I have a child theme and made changes to the style.css document. These changes did not show up in the reload of the page because there is no mention of version ...
1
vote
1answer
31 views

why enqueued styles in header.php shows in footer?

I`m using this code in functions.php: add_action('wp_head', 'addMyStyle'); function addMyStyle() { wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', false, '1.0',...
0
votes
1answer
45 views

Plugin and themes are adding the same stylesheets

/vendors/font-awesome/font-awesome.min.css? ver=2.9.10 /yith-woocommerce-wishlist/assets/css/font-awesome.min.css? ver=4.7.0 /theme/css/font-awesome.min.css **this csss are from different ...
1
vote
1answer
2k views

Enqueue custom font file with rel=“preload”

I'm using a custom font on my WP site. It is now included with @font-face css attribute. But I'm wondering if there is any way to wp_enqueue this file with the attribute rel="preload" and may be some ...
1
vote
2answers
50 views

Deregistering a script in Wordpress seems impossible

I tried everything. I even removed all content in functions.php and created a whole new file with just this: function wpdocs_dequeue_script() { if (is_singular()) { wp_dequeue_script( 'gdrts-...
0
votes
0answers
43 views

Why can I not deregister my style and script on custom post type?

I have a website where I have a custom post type with some single pages attached to it. Problem: I can't deregister the scripts and styles on my custom post type single pages. This is my code: ...
1
vote
1answer
203 views

How to organize priority of plugins CSS files?

I'm developing website with theme (Astra Pro with child theme) and plugins. While I'm checking my performance in Chrome Dev Tools trace shows non-critical stylesheets with high priority. Example — ...
0
votes
1answer
119 views

How to remove all enqueued assets from the active theme?

https://gelwp.com/articles/removing-all-enqueued-and-default-css-scripts-in-wordpress/ has code that removes all the enqueued styles including those that may be coming from other plugins besides the ...
0
votes
1answer
55 views

How to make the RTL.css the dominant css code?

I have a multilingual website, English (default) and Arabic, and also a parent theme and a child one. Now, I want to load the CSS on this order: In English: Parent Style.css then Child Style.css In ...
2
votes
1answer
105 views

Style reset password page? /wp-login.php?action=rp

I cannot figure out how to style the reset password page. And I do not mean the page where you request it, I mean the page you are shown when you click the link in the email to set your new password. ...
0
votes
1answer
36 views

Are there any caveats to compiling all of my theme's SCSS into the style.css file in the theme root?

I work in WordPress development and I've always been told by more seasoned WP devs to compile my theme SCSS into a separate style.css file, typically into a sub-directory like assets/css/style.css. ...
0
votes
1answer
33 views

Enqueued stylesheet appends query string, causing “SyntaxError: Invalid or unexpected token”

function renderProductPageUi() { wp_enqueue_style('stylesheetHandle', plugins_url('pluginName/semantic/dist/semantic.css')); require_once ('templates/offerBox.php'); } add_action('...
0
votes
0answers
63 views

Load script and styles using an array of resources

I want to simplify the scripts and the stylesheet loading in my wordpress plugin. I have this code style now, but I want to implement a best solution, this to encache the function readbility. Is there ...
1
vote
1answer
40 views

How to remove style and js from theme and add your own style and js where shortcode is used?

I making a small plugin for wordpress and that works through a shortcode. is it possible that the page that uses my shortcode has only my js and style rather than having theme style and js as well. I ...
0
votes
1answer
15 views

How do I ensure I can loop through every enqueued script and CSS?

I'm on a bit of an efficiency drive. To this end, I would like to check all the scripts and CSS that get enqueued on my multisite setup. I plan to check that they are offloaded to public CDNs if ...
0
votes
1answer
235 views

Dequeue Scripts and Style for Mobile not working?

I've followed a few tutorials on Dequeueing and Deregistering scripts and styles for WP - trying to optimise my site speed. Initially I could dequeue and deregister, until I added a condition for ...
0
votes
2answers
319 views

functions.php - inject inline css from file

I would like to read from a .css file and inject it as an inline style in wp_head. it's possible? i've tried this "Add inline css to theme" solution but it doesn't do what I expect because I expect ...
0
votes
2answers
499 views

Move dashicons.min.css to Footer

Hey there WordPress community, Google page speed is moaning about dashicons.min.css being on our site. However, we need it for the Mega menu. I wanted to know if it's possible to move it to the ...
1
vote
3answers
2k views

How to dequeue / deregister any theme styles and scripts

Is it possible to some how make my plugin dequeue / deregister any styles and any scripts from what ever theme activated. so it doesn't matter what theme will be installed the styles and scripts of ...

1
2 3 4 5
10