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
0answers
5 views

Enqueue css after shortcode [duplicate]

I am writing a plugin (video player) which has few different stylesheets (separate css files) based on its look. My problem is that I know which css file I need to enqueue after I read shortcode ...
0
votes
1answer
20 views

Best way to enqueue CSS and JS in a specific location

I'm putting CSS and javascript files in a created directory inside a created directory inside wp-content and my enqueue code is going in an mu-plugin. Due to how I have set-up my wordpress multisite ...
1
vote
1answer
29 views

How to enqueu php files with custom variable & conditionals?

Hi I have taken over a website with half-customized theme. It was an outdated theme with bunch of scripts and formatting. Currently I encountered a small issue when enqueue stylesheets in ...
0
votes
0answers
10 views

How can I properly enqueue tags <link> in WordPress to use with Web Components?

The Chrome browser supports Web Components and I would like to add a number of them in WordpPress pages, but using the queuing mechanism as in the case of the functions wp_enqueue_script and ...
0
votes
1answer
34 views

Understanding wp_enqueue_style

I am trying to understand how wordpress works, but I am having issue understanding how wp_enqueue_style(), wp_enqueue_script() works in relation to page output. From my understanding, these functions ...
0
votes
0answers
14 views

Enqueue more than 2 scripts from cdn with a callback

this subject has been covered here and it works but my questions is how to do this for more urls? for example i need to load bootsrap js / css, font awesome, animated.css from external cdn but with ...
0
votes
1answer
17 views

Why won't my Custom CSS Load

I'm in the process of adding a jQuery plugin to a site I'm working on. Needless to say it requires loading a custom script; also a custom stylesheet. Starting with the stylesheet I've been ...
0
votes
1answer
24 views

custom template - override plugin template in child theme - issue with scripts

I'm using a custom template for the single-listing.php from WP Listings. I've used my own theme (Canvas by woothemes) single post template, and included the wp-listings code. ...
1
vote
1answer
35 views

Loading custom CSS

I've done some searching and can't seem to find the appropriate solution for a particular problem I'm having. I've created an option within one of my themes that allows the user to edit any element ...
0
votes
2answers
25 views

Enqueue stylesheet in plugin for wp-login.php

What I have: A basic plugin that's calling a stylesheet contained in the plugin folder: function my_login_enqueues() { // First attempt: //wp_enqueue_style( 'custom-login', ...
0
votes
1answer
33 views

Using wp_add_inline_style without a stylesheet

I need to add custom inline styles to the header of a custom theme I'm creating. I've come accross the wp_add_inline_style() function, which works but doesn't really suit me as it depends of a ...
0
votes
0answers
20 views

How add style in wp after main theme style.css

I try add style via plugin which should overwrite main theme style.css I use this code but it is not help me. function css() { wp_enqueue_style( 'css', plugins_url( '/css/style.css', __FILE__ ...
0
votes
0answers
29 views

Enqueue custom jQuery UI theme to override Google CDN theme

I'm trying to override the jQuery UI theme that wordpress enqueued from Google CDN link but I have not found a solution to my issue. I have my stylesheet enqueued correctly in my plugin but the styles ...
0
votes
1answer
23 views

Get info (url) from already enqueued styles

I am building a theme and using Easy google fonts WordPress Plugin. I created several typography controls within Theme Customizer for Post content,Post header, Author page content, Single Post ...
4
votes
1answer
1k views

Issues enqueueing parent & child theme stylesheets with revised Codex method

This post brings up a few questions I've encountered pertaining to the recent changes around stylesheet enqueueing methods brought up in this thread and this thread. The issues I encountered came up ...
0
votes
1answer
34 views

What is the correct way to enqueue multiple css files in WP?

I am building a Bootstrap site on WordPress and need to be able include multiple stylesheets. However, when I enqueue them as follows, only the first and third style sheets show up in the page ...
3
votes
2answers
42 views

Why shouldn't @import be used to import a parent theme into a child theme?

I have some experience with Wordpress but I've been away from it for awhile. I've seen many examples of using @import in the beginning of the child theme to import the parent theme. I was surprised ...
1
vote
1answer
93 views

Confused about how to use wp_enqueue_style

I've read the updated codex about using wp_enqueue_style instead of @import. I'm a newb and just flat out confused how to use this. My theme is athletica and my child theme is athletica-child. Do I ...
0
votes
3answers
79 views

Why is my css and js not enqueued until footer?

add_action( 'wp_enqueue_scripts', function ( ) { global $post,$pageparent; if(in_array($pageparent, array($post->ID,$post->post_parent))){ wp_enqueue_style( 'products_pages', ...
1
vote
1answer
35 views

How to enqueue a random css style?

I want a random CSS style file to load on my site with each page view so I can play with colors backgrounds. So I put all my styles in a folder, I named them 1.css, 2.css, etc. and I have added: ...
1
vote
1answer
85 views

Using multiple versions of jQuery while still calling it like WP likes

I have two JS plugins inside my plugin. One uses jQuery 1.7.1 and the other 1.9.1. I need to have each of them use different version. This is how things are at the moment: Plugin php file: ...
0
votes
1answer
76 views

Prevent a base themes css file from loading

I have created a child theme from the openstrap theme and rather than use Openstraps bootstrap css file, I would like to use my own custom bootstrap css file (using bootstrap custom sass, which is all ...
0
votes
0answers
51 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 ...
0
votes
0answers
56 views

Why are my parent styles loading after my child styles?

I am trying to build a child theme that uses SCSS. However, every time I make changes and recompile my stylesheet, it gets overridden by the parent stylesheet. This is because, in the head of my site, ...
1
vote
2answers
101 views

Adding Font Awesome to WP Plugin

I'm trying to use font awesome icons for my plugin. I've read this page in the codex and this question. Here's what I've tried so far: I've added this on wp-plug-in.php (or should it be somewhere ...
0
votes
1answer
87 views

wp_enqueue_style in WordPress plugin class not working

I'm trying to add a stylesheet for my plugin class settings page, but the CSS is not loading. I followed the 2nd example at http://codex.wordpress.org/Function_Reference/wp_register_style to create ...
0
votes
1answer
26 views

Different styles on multiple pages

I'm using _s to build a theme. I want to have different styles for different pages. I can figure out how to get two pages working but I want different styles for 5 pages? Maybe an else if statement? I ...
2
votes
1answer
56 views

Stylesheet from wp_enqueue_style is overwritten by plugin

I am using Font Awesome on my theme. wp_enqueue_style('fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'); I am using another plugin that uses Font Awesome, but ...
0
votes
1answer
121 views

Function to load correct CSS for Template not working

I have three templates I want to be able to use (Index Page, Main Template, and Default). I was able to add a "if/else" statement into a function to get the correct CSS file to load depending on which ...
0
votes
2answers
97 views

Page Template Won't Load Correct CSS File

I can't get the correct css file to load for my page template. The page is correctly loading the template but still using the default css file. This is the code I'm using to load the page template's ...
2
votes
1answer
179 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
89 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
21 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', ...
3
votes
2answers
110 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 $wp_scripts, ...
4
votes
1answer
167 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 ...
0
votes
1answer
90 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
79 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
1answer
44 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 ...
0
votes
1answer
42 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
234 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. ...
-1
votes
1answer
34 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, ...
1
vote
0answers
129 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
69 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
322 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
57 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" ...
2
votes
1answer
30 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
67 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 ...
0
votes
0answers
60 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
313 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
2k 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 ...