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

Dynamically Load Styles and Scripts from Theme Functions.php

I am attempting to dynamically load stylesheets and scripts based on the template name. So if I have a template named page-signup.php then it will load the corresponding stylesheet page-signup.css and ...
0
votes
1answer
484 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
2answers
455 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
197 views

Child Theme version is set by parent theme, that isn't correct

I'm using Genesis as my theme framework, and while Genesis is at version 2.0.1, my theme is a different version (1.0). When it adds the style.css line in the header call it is appending the wrong ...
0
votes
1answer
35 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
0answers
17 views

Load mutiple stylesheets inside one IE condition

I want to load Load mutiple stylesheets inside one condition for Internet Explorer: wp_enqueue_style('ie-style', get_template_directory_uri() . '/style-ie.css'); wp_enqueue_style('ie', ...
2
votes
1answer
59 views

Get list of scripts / styles and show file which enqueued them

I want to show what scripts and styles have loaded on a page and which plugin / theme / file has added them to the page. We can show all scripts and styles using: <?php global ...
4
votes
1answer
78 views

Duplicated CSS files using wp_enqueue_style()

I've noticed that in the source code of my website there is Font Awesome loaded five times. Loaded versions are 3.2.1, 4.0.1, 4.1.0 and more. Shortcodes plugins, page builders, the theme and/or ...
22
votes
7answers
8k views

Conditionally Loading JavaScript/CSS for Shortcodes

I released a plugin that creates a shortcode and requires a JavaScript file and a CSS file to load on any page that contains that shortcode. I could just make the script/style load on all pages, but ...
0
votes
1answer
68 views

How to add php stylesheet to admin section instead of admin_head hook

how can we do the below code using separate file let say admin-style.php add_action('admin_head', 'custom_admin_style'); function custom_admin_style() { $bg_color = get_option('custom_color'); ...
0
votes
1answer
30 views

Parse error syntax error unexpected t_string [closed]

I'm getting the following error: PHP Syntax Check: Parse error: syntax error, unexpected 'qtip' (T_STRING), expecting ')' in your code on line 14 in this code: <?php // Always use ...
0
votes
0answers
53 views

Theme Loading Into Dashboard

I'm having this really weird, never seen before, issue ... whenever I visit the Dashboard, after about 3-5 seconds, my theme loads into the Dashboard layout. It's like the theme's stylesheet is being ...
0
votes
1answer
30 views

Print all inline styles to head

Currently working on a project here http://palanquin.shrimp-works.com. When I try to validate what I have done so far, using http://validator.w3.org/, I get lots of this error Element style not ...
1
vote
1answer
2k views

Inbuilt style for jquery-ui-datepicker

I want to use the datepicker that gets bundled with WordPress on the front end of a website. I enqueued jquery-ui-datepicker but the datepicker isn't styled(no js error in console). Is there a ...
0
votes
1answer
28 views

Disable child theme css on certain pages

I have activated child theme and would need to completely disable the child theme css on certain pages, leaving only the parent theme css. How can this be done?
1
vote
1answer
84 views

Add external css to Contact Page

I am trying to add custom CSS to my contact form in wordpress which is a wp page which loads at mysite.com/contact. I don't want to edit any existing codes, I want to do this writing a simple plugin. ...
0
votes
1answer
26 views

Enqueue script/style with multiple GET parameters

I am trying to enqueue a style with two GET parameters, but the output is not correct. Here's what I have: wp_enqueue_style('colors-css', '/root/assets/css/colors.css?style=blue'); The problem is, ...
3
votes
2answers
778 views

How to add stylesheets only to pages with specific shortcode?

I'm running a function on pages where the shortcode [make-me-a-map] is used. It enqueues javascript to the page and makes a map. That part works fine (woot!) but I'm having trouble with adding the ...
1
vote
0answers
75 views

Combining multiple stylesheets into one conditional block

I have multiple IE specific stylesheets that I need to add to my theme (combining them is not an option at this time), in addition to the standard ones. I am able to get this to work using the ...
0
votes
1answer
103 views

Hook after wp_enqueue_scripts

I want to perform action when scripts are loaded. I mean when scripts are enqueued i want to take some action. Is there a hook after_wp_enqueue_scripts?
0
votes
1answer
39 views

Split Media Queries in different files!

I woke up this morning with a thought. Is it a good idea to split the different media queries in different files, check the width of the page in functions.php and then with an IF call the "correct" ...
0
votes
1answer
66 views

Enqueueing a code block from an options framework

I'm currently working with the Redux Framework to allow users of my theme to add additional CSS and JS code to their theme's header and footer, respectively. Redux stores this code in a global ...
2
votes
1answer
23 views

Is it possible to change the path of a css file that is registered through wp_enqueue_style()?

The theme I am using already calls the wp_enqueue_style function to enqueue a css file. I want to whether it is possible to change the css file path before it is actually outputted on the page. Why ...
0
votes
0answers
66 views

How to enqueue stylesheet after rtl.css? [duplicate]

When you use rtl language by default wordpress enqueue rtl.css file at the end of all stylesheets. what I need is how to enqueue a stylesheet after rtl.css stylesheet so the result should be like the ...
8
votes
4answers
4k views

Remove Open Sans from Twenty Twelve theme

I´m creating a child theme for Twenty Twelve v1.0 and I want to remove the Open Sans font. Open Sans is added in Twenty Twelve´s functions.php: wp_enqueue_style( 'twentytwelve-fonts', ...
1
vote
2answers
1k views

How to add dynamic inline style?

I want to add dynamic CSS, so currently I am adding directly to the div, ie: $color = "#000000"; echo '<div style="background:'.$color.'"> Is it bad to add code like above? I have read in ...
0
votes
0answers
28 views

Can I use wp_add_inline_style() inside a function that gets called from a template file (not a hook)?

I'm building a theme that has a 'layout builder', and one of the layout options is a slideshow. There are customiseable style settings for each instance of a slideshow on any page, which means I need ...
0
votes
1answer
187 views

wp add inline style in loop

I want to add inline styles thanks to the wp_add_inline_style wordpress function. The inline styles will be added in a loop. In my case, I output an isotope grid in my loop and this grid can have ...
1
vote
2answers
723 views

wp_enqueue_style for Plugin with multiple stylesheets

I'm making a navigation plugin which adds animations to your wordpress navigation. I read in Wordpress Codex that I would need to use wp_enqueue_style(). First, How do I use this code for multiple ...
1
vote
0answers
66 views

How do I view registered syles and scripts for enqueue

I know that wp_register_style(), wp_deregister_style() and wp_enqueue_style() are used for css style registration and enqueue management. However, I am interested in viewing ALL registered styles ...
-3
votes
2answers
310 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
3answers
204 views

Asset loading with gulp.js or Grunt

I just started using gulp.js which is a task runner like Grunt and a lot of the sites I work on are using WordPress so I was wondering if anyone has some ideas about how to use the combined scripts ...
0
votes
2answers
19 views

is there a way to get all queued scripts/styles into a template without `get_header()`?

in my main plugin page i check if a certain page is visited if so, i load a certain template. in the following way: add_filter( 'template_include', array($this, 'includeTemplate'), 99 ); public ...
1
vote
2answers
464 views

Override theme style with other CSS on a specific page

The wordpress theme I bought has some jQuery UI styling included in its default CSS file. The problem is I have a plugin that uses jQuery UI and the theme's default CSS makes the plugin corrupted. I ...
0
votes
3answers
1k views

Loading scripts & styles from a meta box callback function

Case: I got a set of classes that build form fields based on data from an input array. The class can build the following types of form fields: input (basic, hidden, password) textarea radio ...
0
votes
2answers
102 views

How to make CSS load live based on options clicked in the theme customizer?

I have a problem. I am trying get the theme customizer load a different CSS file based on what radio input in clicked, live! It works so far right now that option is saved when I click "Save & ...
0
votes
2answers
52 views

Some questions about how proper add 2 CSS file in a WordPress theme?

I have the following situation loading a CSS. I have a WordPress theme that load a style.css settings file by this code into my functions.php file: /* Function automatically executed by the hook: * ...
2
votes
2answers
2k views

How to override enqueued styles using a child theme

I'm creating a child theme (My first in over 3 years) of a WooCommerce theme and I'm having some trouble with the fact that some of the layout styles are enqueued in the parent theme and I'm having to ...
4
votes
2answers
250 views

Why I can't add a CSS style in this WordPress theme?

I am trying to add a CSS style to a WordPress theme that I am developing as is shown in this tutorial: http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/ ...
4
votes
1answer
1k 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
1answer
115 views

Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?

My site's url is set up to include www in settings -> general. I also put it at the very top of my functions.php: update_option('siteurl','http://www.federal-lawyer.com'); ...
1
vote
0answers
184 views

Adding css to wp_head from shortcode

I'm trying to add CSS to wp_head, from within the method called to render a shortcode. I know that wp_head does not take any parameters, so I'm trying to figure out the following: The method called ...
0
votes
1answer
38 views

How to include a file only on dashboard widgets page?

I want to add some styles to the widgets input fields. Therefore I want to include a style.css file only on the wp-admin/widgets.php page. How can I detect the above page and include file there?
0
votes
1answer
57 views

get_template_directory adding FTP root folders in urls

I am creating a theme, and now I am adding some functionality for my custom post type, such as different metaboxes in post page, extra post config page. It seems when I try to get the sites theme ...
1
vote
1answer
408 views

Load custom css after bootstrap

I have this in functions.php. How can I modify it so that my custom css is loaded after bootsrap.min.css? function register_css() { wp_register_style( 'bootstrap.min', ...
1
vote
2answers
241 views

Avoid to load default WP styles in login screen

Is there some way to avoid the load of default WordPress styles in login screen to only load my custom stylesheets? Actually I'm using this code: function login_styles() { // Sets the styles if ...
0
votes
1answer
29 views

Wordpress include scripts and style in plugin page

I am working on a Wordpress plugin where I want to include some jquery scripts and stylesheet. I found dit piece of code in an article and this should do the job, but it doesn't work for me. Can ...
1
vote
1answer
939 views

Why wp_register_style() is important while I'm using a complete wp_enqueue_style()? [duplicate]

Currently I'm working on a theme, and did some styles and scripts enqueue. When enqueued the scripts, I used wp_register_script() first, and then enqueued with wp_enqueue_script() - because I got ...
1
vote
1answer
49 views

Include user defined styles without including wp-load

I've looked through the answers on here and none quite match my situation. I have custom CSS that a user can edit and it is saved in the options. I use wp_enqueue_style to include a PHP file with a ...
1
vote
2answers
83 views

CSS file not registering through add_action

Im having a problem to register and load a gallery css code from my home page. Rest of the styles are loading fine, but this flexslider is not registering. Any guidance appreciated. <?php ...