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.

learn more… | top users | synonyms

0
votes
1answer
21 views

Child style loads before all parent styles

I'm trying to move to child themes, but seem to have a problem with the order that stylesheets are loaded. I have a parent theme, which is using wp_enqueue_style to load all stylesheets, this ...
0
votes
1answer
20 views

ERROR MESSAGE: Missing index.php—Child Theme

I'm trying to load a child theme on a Custom WP Theme that was created by another developer. I created a stylesheet based on the Codex instructions but I'm not sure what's going wrong. Here's my ...
1
vote
2answers
42 views

Remove wp_add_inline_style

Is there a way to remove styles added with wp_add_inline_style? I noticed if I call wp_add_inline_style multiple times, it just keeps adding style, it does not overwrite what was added before. The ...
1
vote
1answer
37 views

How to add extra attribute to stylesheet link?

Following Keith Clarks advice, i'd like to load my fonts asynchronously. I try to achieve that by adding: wp_enqueue_style( 'font-awesome', URI . '/fonts/font-awesome/css/font-awesome.min.css' ); ...
0
votes
1answer
45 views

How to offload CSS and JS files from wp-content/themes folder?

Am using the WP Offload S3 plugin and not able to offload the CSS and JS files within the themes folder. Am trying to use wp_enqueue_style() like below in wp-content/themes/spark/functions.php ...
-2
votes
1answer
28 views

index page is not loading [closed]

anndoe | |-------css/ anndoe.css |-------js/anndoe.js |--functions.php |--header.php |--index.php |--style.css I added below code to functions.php, and my index page doesn't show up. iF I remove ...
0
votes
1answer
27 views

child parent styles enqueue order

I have a wordpress theme which I hacked to my specifications. I know I'm not supposed to do that but it was long ago so now I'm trying to implement a child theme and I've put those revisions into the ...
0
votes
0answers
48 views

wp_enqueue_script and wp_enqueue_style doesn't load content over https

I have a problem with serving scripts and styles over https. Scripts included via functions.php and used proper get_stylesheet_directory_uri(), here's some code: add_action( 'wp_enqueue_scripts', '...
2
votes
1answer
44 views

Why isn't my theme processing SASS?

It's my understanding that Wordpress now processes SASS files but for some reason mine don't work. I'm trying to call it using wp_enqueue_style directly in header.php via the head tag: <?php ...
2
votes
1answer
84 views

Understanding child theme functions.php

I have successfully created a child theme for the Emmet Lite template, using the information provided on here and here The CSS file of the child theme looks like this: /* Theme name: Emmet Child ...
3
votes
1answer
157 views

Loading a child-theme's style.css after the parent's

I'm trying to load my child theme's style.css after the parent theme style.css has already loaded. However, I have noticed that the style.css doesn't need to be enqueued since it's implicitly enqueued ...
2
votes
1answer
48 views

Add Font Awesome Embed CDN Script To WordPress

This is my original code that pulled Font Awesome icons, which is placed in my functions.php file: wp_enqueue_style( 'prefix-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.1/css/...
5
votes
3answers
218 views

how to include other plugins css files in a shortcode?

I've coded a plugin that creates a shortcode, among other things. That shortcode expects a post_id parameter, it extracts the content of that post and it returns the filtered content of that post (e.g....
1
vote
1answer
33 views

Trying to properly register and enqueue stylesheet in WP but nothing is rendered

I'm told it's very important to register and enqueue styles and scripts in WordPress even though it's a real pain in the behind. I had no problem with the scripts however when I try the styles, ...
0
votes
2answers
78 views

Ideal inline dynamic CSS injection

There is a code in here that dynamically load custom script. <?php function my_styles_method() { wp_enqueue_style( 'custom-style', get_template_directory_uri() . '/css/...
0
votes
1answer
50 views

If is multiple page templates

Via functions.php, I'm trying to enqueue specific scripts and styles based on two separate page templates. Here's what I've tried: if ( !is_page_template('page-templates/page-index.php') && !...
1
vote
1answer
66 views

functions.php How to add css/js depending on Template Name?

How to add custom CSS and JS files depending on the Template Name? For example my normal pages will all have a green background color. Now I want that Blue Template will have a blue background color ...
0
votes
2answers
25 views

Dequeue, Unregister, Remove Action - Not Working on Plugin

Several years ago, not really having a handle on the best practice for running a MultiSite network, I often network activated plugins. Later I realized this was a mistake because not all the sites ...
0
votes
1answer
26 views

How to check widget-cpt meta and display its custom css in the head?

When dealing with a widget that is a custom post type, is there a way to detect when that widget is displayed, then check its post meta for any custom css and enqueue it in the head of the site? ...
1
vote
1answer
72 views

How to NOT call Font Awesome or font icons in WordPress

I have a theme that makes use of Font Awesome icons by default. I have replaced all of them with custom .png icons using CSS. However, on web page load, the font-awesome icons takes up a size or ...
0
votes
1answer
82 views

linking stylesheets and scripts with functions.php

I am following along with this tutorial. I am trying to link the javascript and css files that are usually linked in the header using wp_enqueue_scripts in functions.php. With what I have now, only a ...
0
votes
1answer
35 views

javascript file is not enqueing

I'm working on a custom wordpress theme. The js file is in wp-content/theme/custom-theme/js/bootstrap.min.js. I'm not able to load this on page while I can load the custom CSS file. My code is: ...
0
votes
1answer
55 views

How to dequeue / deregister parent theme style

I'm making a child theme, and I'd like to remove the Google font style that it calls for in 'fonts-style' function nada_theme_styles() { wp_register_style( 'fonts-style', '//fonts.googleapis.com/...
0
votes
1answer
139 views

Stuck with Enqueue Styles for multiple css files in a child theme

I am brand new to WP and I have been reading a ton of posts and trying out different examples out to get the wp_enueue_style to work for me but to no avail. I am using refur wp theme and I made the ...
0
votes
1answer
16 views

Is there a way to deque the style with higher priority?

I'm using a theme that chooses to add/remove different depending on what browser etc that is recognized by the http header. I'm having an issue with this because it doesn't work all the time. The ...
1
vote
3answers
40 views

How are updates to the style.css file in child theme recognized?

When I update the style.css in my active child theme, the changes are not immediately picked up. I tried doing a touch on the file, but the results have been inconsistent. It worked once, but did ...
0
votes
2answers
135 views

Give priority to child theme stylesheet

I've created a child theme and the main style.css works perfectly fine. However, the parent theme has another stylesheet which I want to import and create the same for child theme and use it instead. ...
0
votes
0answers
65 views

Tesseract-Child: Editing CSS other than Style.css

I hope some one can help me. So here is what i want to do. I have tesseract theme by Tyler Moore. I want to change the color and style of the site name that appears in the header. No potion provided ...
0
votes
0answers
24 views

Option for en-queue and de-enqueue stylesheets

I wanted to create option in the admin area on a custom page to load and unload stylesheets or scripts using a dropdown option, only 1 can be selected at a time so when one is enqueued the other ...
0
votes
1answer
216 views

Chosen Select jquery Not Working in Plugin

For some reason js and css files are not loading in my plugin. Here's what I have: (ostensibly unrelated code replaced with '...') class Location_Specific_Menu_Items { private static $instance = ...
2
votes
0answers
55 views

iris color picker in widget - click event doesn't fire when initially when widget is first created

I added the wordpress(iris) color picker to a widget, and the color picker is not clickable when the widget is first created. My guess is that it's where/how the javascript file is being enqueued, but ...
0
votes
1answer
41 views

How to add conditionals for IE browsers between certain versions?

I know that wp_script_add_data and wp_style_add_data are the correct functions for adding IE conditionals. For example, this: wp_script_add_data( 'foo', 'conditional', 'lt IE 9' ); Would get you ...
1
vote
1answer
114 views

Enqueue style for Password Reset page

I've enqueued a style for my WordPress login page like so: function login_stylesheet() { wp_enqueue_style( 'custom-login', plugins_url( 'style-login.css', __FILE__ ) ); } add_action( '...
0
votes
1answer
36 views

enqueue_parent_style

I am trying to change my @import style.css to wp_enqueue_style for my child themes. I added the following into my functions.php child theme and it returns a 500 error. I looked at this and pretty much ...
0
votes
1answer
65 views

Why wp_enqueue_style() is adding CSS class?

Why my stylesheet links are getting -css at the end? How can I remove that ? I have this in my custom function file: function enqueue_styles_scripts() { wp_enqueue_style('bootstrap', ...
0
votes
0answers
96 views

How to output wp_enqueue_style() in HTML head instead of footer

I added some actions to wp_enqueue_scripts to load my custom css and js files in the header section by using wp_head(); right before the closing </head> tag. function mytheme_scripts(){ // ...
2
votes
1answer
305 views

Remove specific CSS and JS from the head

I'm trying to remove some specific lines from the WP_HEAD. Now my header looks following way: <link rel='stylesheet' id='bootstrap-css' href='/themes/wp-e/css/bootstrap.css?ver=4.2.2' type='text/...
0
votes
1answer
46 views

How Can I Use A Child Theme Effectively When Parent's CSS Is Located in a 'CSS folder'?

I already have a child theme and a new style.css for it, but CSS changes in my child theme's style.css don't do anything because the parent theme's different CSS stylesheets come from a "CSS" folder. ...
0
votes
1answer
31 views

CSS only loads in backend

This works to load CSS in the backend. I'm trying to load the CSS in both the backend and the frontend though. What am I doing wrong here? function load_top_bar_style() { wp_register_style( '...
1
vote
2answers
53 views

How do I load custom scripts and styles for a page?

Different pages often need different set of scripts and styles for them. I use functions.php and construction like this to load scripts and styles: function load_assets() { wp_enqueue_style( '...
0
votes
3answers
75 views

Changes in enqueued / registered stylesheet paths not updating—why?

I'm attempting to modify a WordPress theme so that it appends a version number to a particular stylesheet. This is all done on a local development machine, tested on a staging server, too, for good ...
0
votes
1answer
36 views

How to make a cookie be on the whole site instead of being on a specific page/

So I had an idea to make a button that swaps between css files in order to do random stuff such as making 2 backgrounds that the site users will be able to swap between. I had no idea how to do it, ...
0
votes
0answers
68 views

Admin - Dequeue unnecessary scripts/styles

Currently, I'm working on a plugin where I use custom post type. In each post type edit page I've got meta data fields to set advanced functionalities. However, because the interface needs to take ...
0
votes
1answer
133 views

Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme

With child themes we are supposed to leave parent functions.php in tact and extend it with the child functions.php. However parent functions.php typically define a whole load of include/requires which ...
0
votes
1answer
26 views

Why isn't my plugin script loaded in the backend?

I've made a WP plugin that needs to load a script in the admin interface. This was working yesterday, but after updating it, it's no longer loading. I have the following code in my functions.php: ...
0
votes
1answer
50 views

using wp enqueue style to create a CSS file specifically for a page template

I am trying to create a CSS file that only works for one page template. I am trying to do it using wp enqueue style but to no avail so far. I was able to get it to work (sort of) using the following ...
0
votes
2answers
84 views

Enqueued Stylesheets Effecting Admin Styles

I'm building a custom theme for a client and I've been adding stylesheets incorrectly for a while, so I decided to do it the correct way :-). However, when I add the stylesheet to my functions.php ...
0
votes
1answer
78 views

Enqueue less file not working in child theme?

In my child theme I have: add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style....
0
votes
1answer
70 views

Customize the reset password page?

How can I style the reset password page, where I put in my new password? I tried going like this: function my_login_stylesheet() { wp_enqueue_style( 'custom-login', ...
0
votes
1answer
27 views

Should I be enqueueing styles/scripts once and then dequeueing them?

I'm new to WP dev and I want to add my own CSS/JS to an existing plugin via an extension that runs after the plugin has loaded (e.g. do_action('plugins_loaded')). This plugin did not have a payment ...