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

-2
votes
1answer
26 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
20 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
35 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
0answers
36 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
59 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 ...
5
votes
3answers
197 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....
3
votes
1answer
125 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
37 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/...
0
votes
2answers
71 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/...
1
vote
1answer
144 views

Adding inline styles from a widget

I'm working on a theme that has an optional widget to allow users to put some site elements where they want. One of those is a list of social media icons. These are font icons, so they can be styled ...
1
vote
1answer
28 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
3answers
72 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
349 views

Check for Twitter Bootstrap Loaded

I am developing a plugin that uses Twitter Bootstrap Modals, but would like to prevent loading bootstrap if it's already loaded. <a href="https://github.com/MaxCDN/bootstrap-cdn/issues/111#...
1
vote
1answer
1k views

Only let plugin add actions to wp_head & wp_footer on single posts

I'm using a a plugin (Comments Evolved) on a recently built site. The issue I'm having is that this plugin globally enqueueing and adding actions to the head and footer of all pages. I'd like to ...
0
votes
1answer
33 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
2k views

wp_enqueue_style with style.php and Wordpress functions

I use wp_enqueue_style to add my stylesheet, like this: <?php wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.php', false, '1.0', 'all' ); ?> It works fine BUT I need ...
1
vote
1answer
49 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
25 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
59 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
71 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
33 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
50 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
101 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 ...
20
votes
2answers
15k views

How do I dequeue a parent theme's CSS file?

My parent theme (Starkers) adds a CSS file that I'm trying to remove (I want to use @import instead so I can override styles more easily). Starkers has the following in its functions.php: add_action( ...
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
82 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. ...
7
votes
1answer
4k views

Enqueue a stylesheet for login page and make it appear in head element

I try to style the login page in my theme. Very simple: add_action( 'login_enqueue_scripts', function() { wp_enqueue_style( 'TEST', get_template_directory_uri() . '/css/login.css' ); }); ...
0
votes
0answers
58 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
195 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
53 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
38 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 ...
0
votes
1answer
97 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 ...
2
votes
1answer
258 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
147 views

Custom Plugin - CSS works, JS doesn't

In the plugin I'm making, I use separate js and css files (____.js, ____.css). This is the first time that I've included an external .js file in anything. I'm registering and enqueueing both in the ...
0
votes
1answer
58 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
1answer
119 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
0answers
85 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
3answers
2k views

Why does wp_enqueue_script ignore my 'wp_head' hook?

I would like css_head_scripts and js_head_scripts to be appended to wp-head but Wordpress completely ignores it? Am I missing something? function css_head_scripts() { wp_enqueue_style( '...
0
votes
2answers
2k views

Deregister scripts on unnecessary pages using remove_action

To all would-be close-voters: This question is not a duplicate, because I need to remove all scripts added by plugin using remove_action. In Very stubborn wp_register_script / add_action vs ...
0
votes
1answer
43 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
436 views

Unable to load stylesheet via wp_enqueue_style

I am using this <?php// Load the theme stylesheets function theme_styles() { // Load all of the styles that need to appear on all pages wp_enqueue_style( 'main_css', ...
0
votes
1answer
28 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
49 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
1answer
35 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
63 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
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: ...