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
2
votes
1answer
27 views

How to remove plug in styles for WPForms Lite [closed]

I would like to remove the preset style sheets that WPForms Lite applies to its forms. So that I can use my own and not have to cause excess bloat by overriding the preset stylesheet. Currently, I ...
0
votes
1answer
76 views

Dequeue styles with query doesn't work

In my theme there is the following code (that is printing some inline css on the head of my site) final class Design_Scheme { /** * Design_Scheme constructor. */ private function __construct() { ...
0
votes
1answer
21 views

theme style is applied on the dhasboard rather than the website

I am creating a new theme, I created a new directory called mytheme and created three files directly inside the directory where the content is as follow: index.php <?php echo "hellow world&...
0
votes
0answers
86 views

Change the default font used in Gutenberg

In a site I'm building, I'd like to change the default font set in Gutenberg by default for a Helvetica font stack. I've added the following to my child theme blocks.css file: .edit-post-visual-editor ...
0
votes
0answers
47 views

Adding arbitrary data via wp_style_add_data?

I stumbled across wp_style_add_data while reading though someone else's code. I can see a list of keys that the function accepts and trying to add my own but ,data-foo for example, didn't produce any ...
0
votes
1answer
41 views

Add custom css file after plugin css with Wordpress Child Theme functions.php

I am trying to enque a css file thorugh my child themes functions.php after a specific plugin css file with the handle openpos.bill.bootstrap. Unfortunately the current code does not load anything. ...
0
votes
2answers
49 views

Which is the correct way to conditionally enqueue a CSS file?

get_queried_object returns NULL inside a function hooked to wp_enqueue_scripts action hook when going to an nonexistent category URL on my website. If the category exists, the error is not shown and I ...
0
votes
1answer
55 views

How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)

I’ve created a plugin for my child theme, in which custom functions are stored. Additionally, within the plugin, I'm also enqueueing stylesheets and .js which control the output of two templates, for ...
0
votes
1answer
32 views

How to add CSS via custom plugin?

I am making my first plugin. I create a folder in \wp-content\plugins, create a test.css and a test.php file. Here is my test.css: body { background-color: red !important; } Here is my test.php (...
0
votes
0answers
17 views

wp_register_script() and wp_register_style() 4th parameter (version) not working for logged out users

I'm enqueuing scripts and styles from functions.php in my custom theme. The 4th parameter is the version number. It's working only for logged in users. wp_register_script( 'my-handle', ...
0
votes
1answer
17 views

404 Not Found on CSS file even though it's in the correct directory

This is in the template file: function add_pt_style() { wp_enqueue_style ('pt-style', ROOT_PATH.'/pt.css', array(), '1.0.0'); } add_action( 'wp_enqueue_scripts', 'add_pt_style' ); get_header(); ...
0
votes
0answers
58 views

Save custom option in CSS file

I have built this script in order to display a CodeMirror in a plugin and through the CodeMirror integration I can inject and save CSS in the head of the website, the result is very cool but I would ...
1
vote
1answer
42 views

WP CLI Get all Enqueued Scripts and Styles

Normally, I would hook into the wp_enqueue_scripts action in order to gather a list of enqueue'd scripts and styles. However, I have a very intensive process I need to run, thus instead of running it ...
1
vote
0answers
28 views

Enqueue script/style if certain widget has certain value

I want to build a widget by which various social media sharing buttons can be added to front end. In the widget form there will be many checkboxes for social media. Since these sharing buttons require ...
0
votes
0answers
25 views

style.css is not loaded in other template files than index.php (eg. front-page.php)

I am a Wordpress newbie who just started to go through this tutorial: https://developer.wordpress.org/themes/basics/including-css-javascript/#stylesheets So i created a new theme and activated it. ...
0
votes
0answers
23 views

Problem with displaying CSS Stylesheets - Am I adding them correctly in my wordpress child theme?

Is this a proper way to load CSS files into my WordPress child theme? add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); add_action( 'wp_enqueue_scripts', 'case_studies_styles' ); ...
0
votes
1answer
58 views

My CSS suddenly doesn't load anymore [closed]

I've did some small changes on my CSS, nothing crazy, uploaded them to my website. Cleared my cache and suddenly, the website doesn't show my custom styles. Website: http://experienceantwerp.be/ My ...
0
votes
0answers
34 views

higher priority for wp enqueue style

i use the following wp_enqueue_style function in connection with a "add filter" (set "preload" as link attribute) to include a stylesheet. Now iam looking for a possibility to ...
0
votes
1answer
26 views

Enqueued style gets commented if not logged in

When using stylesheets I like to use wp_enqueue_style to have wp handle the loading. For some reason this works perfectly fine when I am logged in. But when I am not logged in the include statment ...
1
vote
2answers
175 views

How to enqueue style in WordPress plugin from theme files?

In my theme files I enqueue many css and js files. I want to enqueue some css files which are same as theme. So, how I can enqueue in plugin ?
4
votes
2answers
355 views

Get parent theme version

How do I get the parent theme's version in a child theme? I want to use it when loading the parent theme's stylesheet. Here's how I load the stylesheets in the child theme's functions.php file: ...
0
votes
2answers
390 views

filemtime(): stat failed warning within a child theme

I am trying to work on my child theme, but I can't get rid of the filemtime(): stat failed warning, which appeared as soon as I activated my child theme. After reading other questions, I understand ...
0
votes
1answer
38 views

How to make my shortcode load scripts and styles, from within the plugin?

This sounds like a silly problem, but I was searching for an answer, and couldn't find anything. And the things that I did find, I tried and didn't work or were very vague. Content My Problem What I ...
0
votes
1answer
84 views

How to enqueue stylesheets in child-theme functions.php?

I know this topic is old hat, but I still got issues with that. I use the elementor child-theme and try to enqueue the following stylesheets hello-child-theme-folder: style.css hello-child-theme/...
0
votes
1answer
15 views

Dequeing Parent Fontawesome Deques Parent Styles

I'm trying to dequeue fontawesome from a parent theme in my child theme. For this I use the following code: function si_dequeue_child_styles() { wp_dequeue_style('wp-bootstrap-starter-fontawesome-...
0
votes
1answer
146 views

How can I force Dynamic CSS via ACF values to update on page load?

I'm trying to dynamically change the background color of a post on scroll to colors set in post options via an ACF color picker. I was able to source enough code examples to get it working (I thought) ...
1
vote
1answer
160 views

How to dequeue wp_get_custom_css in Twenty Twenty Theme

How to remove Additional CSS from loading. It loads as internal style sheet on every page. I am doing this but it is not working. if I print_r(wp_get_custom_css()); It shows the same css. I want to ...
0
votes
1answer
30 views

Remove Stylesheet by URL that has not been enqueued

I am editing the theme Peggi (https://themeforest.net/item/peggi-a-multipurpose-wordpress-children-theme/22094659) over a child theme to make it GDPR compliant. I managed to remove all external ...
0
votes
1answer
10 views

Displaying front side empty with one file attached problem

There is a problem in my custom theme. I add all css and js files in functons.php file. my all files work properly. But my plugin.css file creates problem, when i add this file there is not shown ...
1
vote
1answer
167 views

Google fonts enqueue only imports last font family

I am trying to import three google fonts by adding the following to my functions.php file: function get_google_fonts() { wp_enqueue_style( 'get-google-fonts', 'https://fonts.googleapis.com/css2?...
-1
votes
1answer
17 views

How to laod wp_enqueue_style to another header i created my self

How to laod wp_enqueue_style to another header i created my self name of the header manga-single-reading.php wp_enqueue_style code in wp-manga.php the code is wp_enqueue_style( 'wp-manga-plugin-css', ...
1
vote
2answers
384 views

How to make wp_enqueue_style and wp_enqueue_script work only on custom post type

How to make wp_enqueue_style and wp_enqueue_script work only on custom post type I have install plugin on my wordpress that creat custom post type which is "http://localhost/wordpress/manga" ...
0
votes
1answer
142 views

Why is my wp_enqueue_style() not working?

I am new to wordpress and am trying to develop a child theme on localhost for the first time. I am trying to load style.css using this code in functions.php. This is the entire functions.php file: <...
0
votes
1answer
175 views

Google Fonts not loading correctly

I have enqueued google fonts in the usual way in functions.php: function travellers_field_guide_scripts() { wp_enqueue_style('travellers-field-guide-style', get_stylesheet_uri(), array(), _S_VERSION)...
1
vote
0answers
328 views

wp_enqueue_style not working if the file is in a sub folder

I use wp astra to customize our site and have set up a child theme but for some reason, the wp_enqueue_style is not working if the file is in a subfolder. When I view source the page, it does output ...
0
votes
2answers
31 views

How to check if a post has any one of many shortcodes?

I want to check if a post has one of the following shortcodes, wpdocs-shortcode-1, wpdocs-shortcode-2, wpdocs-shortcode-3. If it found any of those shortcodes, then do enqueue scripts and styles. ...
1
vote
1answer
154 views

Why are files enqueued with wp_enqueue_style and wp_enqueue_script 404 Not Found?

code script Error net::ERR_ABORTED 404 (Not Found) Scrips Not Loaded
1
vote
1answer
145 views

Use wp_add_inline_style to add code to before wp_head?

I’m building a Wordpress theme for Themeforest. In the customizer I’ve given users the ability to also use the rem unit for their font sizes. I’ve created three different settings that control the ...
-1
votes
1answer
18 views

How to load css file in my menu in wordpress

Anyone know how to load css file in my menu in wordpress. use this but it didn't work function wmt_theme_style() { wp_enqueue_style( 'bootstrap-styles', get_template_directory_uri() . '/css/...
0
votes
3answers
44 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
692 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
37 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
1answer
38 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
1answer
142 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
31 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
105 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
72 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
41 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
206 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
279 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 ...

1
2 3 4 5
11