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

1
vote
2answers
36 views

How to enqueue stylesheets?

I am trying to learn WP theme development. And at the moment I got some problems when I try to enqueue my stylesheet (id does'nt load). It is named style.css and located in my theme folder. I have ...
0
votes
2answers
13 views

Load stylesheet on custom admin submenu page

I'm trying to load a stylesheet for a particular admin submenu page. The code below is what I came up with after looking up admin_enqueue_scripts in the codex: function my_function($hook) { if ( ...
0
votes
0answers
11 views

How to list the scripts and styles enqueued for a certain page?

How do I get all the scripts and styles used on a certain WordPress page. I would like to see the following, Name of script/style URL to script/style Version of script/style And if a certain script ...
0
votes
1answer
68 views

Enqueueing a script and a style sheet not working

I am trying to enqueue both a child theme style sheet and a child theme script. I need to enqueue the script because I put CDN links in there for Bootstrap. I know my enqueue isn't working correctly ...
0
votes
1answer
16 views

Why isn't my enqueuing working properly?

I followed this guide to try to enqueue multiple stylesheets in order to get this file picker to work in Wordpress. However, when I am getting an error that says Parse error: syntax error, unexpected ...
0
votes
2answers
43 views

Enqueue styles through the wp_enqueue_style function vs link tag inside header.php

I read that I should insert my style.css file in my theme through the wp_enqueue_style() function because it's not a good solution to add that file through a link tag in the html of the header.php ...
0
votes
0answers
39 views

Stylesheet not loading

I have started on a plugin that shows some basic information of registered users. In order to control layout I want to have a separated CSS file (in plugin-name/css/style.css). However, when I enqueue ...
0
votes
2answers
42 views

How to get rid off default css styles

I have installed html5 blank template and I have created sub theme too by creating style.css and functions.php. But how should I get rid off default CSS styles that come from parent theme?
0
votes
2answers
31 views

Creating Admin Options Page where users can make changes to a theme

I need help to finish this last bit of php code. I'm trying to create an admin options page similar to in admin>settings>discussions like how a user can select an avatar, but instead of selecting an ...
0
votes
1answer
22 views

Including Styles and JS files to work ON my plugin interface

Hey WordPress community, I've been having a couple of issues with trying to add a stylesheet and a JavaScript file which run on my plugin interface. So far i have this: ...
0
votes
1answer
26 views

Wordpress-child problem with many css files in parent theme

Ok, So I'm trying to setup a child theme and can't manage to solve the problem with many different css files in parent theme. When I look at codex guide it's just give example on how to setup it with ...
1
vote
1answer
125 views

Enqueue stylesheets if parent theme has more than one .css file

I just learnt about creating child themes from the Codex , it says to add add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( ...
1
vote
1answer
37 views

How to switch css files according to devices and button click?

I am trying to enqueue a responsive css file if the website is opened on mobile devices. Also I want to switch / enqueue a default or non-responsive css file when a button is clicked. The ...
0
votes
1answer
25 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 ...
0
votes
1answer
33 views

Enqueue CSS file for registeration form - Multisite

What is the best way to enqueue a css file for the register form for a multisite? wp_enqueue_scripts/styles works, but I would prefer it to not keep loading on the frontend all the time as it is only ...
1
vote
1answer
19 views

Stylesheet not loaded on register page

Using WordPress 4.2.2. Im trying to add some custom fields to the registration page. I have gotten the fields to show up there now, but for some reason i cannot get the stylesheet to load there too. ...
0
votes
0answers
21 views

What's the best way to dequeue / remove uncooperative scripts and styles?

So we've got wp_dequeue_script, wp_dequeue_style as well as wp_deregister_styleand wp_dequeue_script... These work well, as long as they've been called correctly in the first place. Some plugins, ...
0
votes
1answer
32 views

Enqueueing Scripts and Styles to page template that has html

I built a custom calculator using html5, css3, and jQuery. I have it live and it works well but now someone would like to put my calc on their WP website and we can not figure out how to get it on his ...
2
votes
1answer
53 views

$wp_styles->registered not giving ALL the styles?

I'm pretty new to Wordpress programming (been using it for a while, but never got into the nitty gritty). So, I'm trying to "minify" some JS/CSS files into common ones. I'm manually joining the files ...
0
votes
1answer
46 views

Plugin Development - Class Constructor Not Firing wp_enqueue_style action hook

Writing my first Wordpress plugin that uses a Class approach. It is being called on a page via a shortcode. In testing, the shortcode is working and the shortcode specific php file is being loaded. ...
0
votes
2answers
37 views

Deregister scripts from plugin

I have an own class that deregisters all scripts and styles and creates 2 cached files one for scripts and one for styles that is registered in the end. This runs inside theme, my problem is that I ...
0
votes
1answer
36 views

Controling css order

In my plugin I need to load css file after the standard style.css. I tried to do that with the priority paramter in the enqueue command but that works only if I modify the specificity of the ...
0
votes
2answers
39 views

Should we explicitely enqueue jQuery and our theme's main stylesheet?

I noticed that if I don't explicitely enqueue my theme's main stylesheet and jQuery in my functions.php, these are loaded anyway. But perhaps it's better for some reason to enqueue them ? What is the ...
2
votes
1answer
52 views

How does one load style.css into a theme?

I've looked up the codex, some tutorials and they talk about adding custom css, but I couldn't find where do I add the style.css? I did this, and still it won't have any effect. /** * Proper way to ...
0
votes
1answer
107 views

@font-face broken in child theme

In my site I'm using Bootstrap for the basic structure (bootstrap.min.css), and using my own stylesheet (style.css) for further enhancements or modification. I declared @font-face in my stylesheet ...
0
votes
2answers
77 views

custom post with loading script per single post

I read many Q&As here on SO...(and elsewhere but they don't count...lol) I think I follow the rules of WP.org but still it does not load the scripts. Scenario: Custom template for post in Php: ...
0
votes
1answer
88 views

Use wp_enqueue_scripts, not wp_print_styles?

Everywhere is said that you need to use wp_enqueue_scripts() instead of wp_print_styles(). wp_print_styles() is located in wp-includes/functions.wp-styles.php. So what does it mean? What should I ...
1
vote
0answers
168 views

why this media query is not working / not loading when I put it in child theme?

I am trying to create a separate style sheet for responsive behavior in a site. my folder structure: magzine/style.css magazine-child/style.css magazine-child/responsive.css Magazine is my theme ...
0
votes
1answer
89 views

FullCalendar in WordPress is not working

I'm trying to implement FullCalendar on my WordPress website in order to display the Hebrew calendar from the Hebcal API. I believe I have loaded all the requisite scripts and styles via use of the ...
0
votes
0answers
16 views

How can I to add css or js to wp_head from shortcodes or widgets? [duplicate]

How can I to add css or js to wp_head generated from shortcodes or widgets?
1
vote
1answer
183 views

How to load css in the footer [duplicate]

I was trying to move the load of my style.css in the footer of my wordpress theme. I have already done something similar with 2 js files and it works fine, they load in the footer: function my_init() ...
0
votes
0answers
12 views

Is it possible to use login_enqueue_scripts to add the stylesheet to head section? [duplicate]

here where I'm having trouble: I need to add my styleshhet to the WordPress login page among the tags <head></head> but my code doesn't work, it always enqueue the stylesheet before ...
0
votes
1answer
64 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 ...
1
vote
2answers
366 views

Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts

Use Case I've been experimenting with Chrome's Dev Tools Workspace features. It includes the ability to edit a file directly in Dev Tools and have the saved stylesheet refresh itself (or even compile ...
0
votes
1answer
79 views

How do I get shortcode, widget and template tag CSS to load in the head only as required? [duplicate]

I have a shortcode, widget and template tag that need to load CSS. I am registering in init, and enqueueing as required. The only problem is, it is adding the CSS loader at the bottom of the page, ...
0
votes
1answer
61 views

font style is not working on domain

I have two domains, one http://www.eu-ohne-mpu-fs.de/, second: http://eu-bw.de/. Second domain is the one where Wordpress Adress(URL) and Domain Adress(URL) is set. First one is pointing to the ...
4
votes
1answer
120 views

How to use wp_dequeue_style() for style enqueued in WP_Widget class

I've got a plugin that makes a widget that enqueues some front-end CSS to style the widdget. I call wp_enqueue_style from the public widget() method in the extended WP_Widget class: <?php class ...
0
votes
1answer
41 views

Modify arguments for parent theme's `wp_register_style` via child theme

Working on a child theme for site with a good deal of separate stylesheets being registered/enqueued from the theme and plugins. I'd like to change some attributes of the <link> tags in the ...
0
votes
0answers
21 views

Enqueue all styles used by Buddypress & its plugins

I am pulling certain functions and widgets from buddypress via ajax to display them on my startpage - activity-stream, activity-update-form etc. As my startpage is a WP-page with my own plugin (which ...
0
votes
0answers
59 views

Child Theme for WooCommerce's Upstart

I'm having trouble with the Child Themes concept, and I am using WooCommerce's Upstart Theme. After Reading the Wordpress Documentation on Child Themes, I attempting to implement a Child Theme for the ...
0
votes
1answer
27 views

Enqueuing scripts and styles in custom plugins

I have a couple of questions regarding enqueuing scripts and styles in custom plugin code. I've recently come across plugin code where scripts were enqueued hooing into the template_redirect action ...
0
votes
0answers
13 views

How to make sure Child styles load after Parent styles [duplicate]

I have setup a child theme for my site. However I'm having trouble getting some of my CSS styles to work properly because some of them load before the parent style and therefore become overruled by ...
0
votes
0answers
86 views

How to enqueue both style.css and style-mobile.css in child theme

This is pretty basic, but I'm not sure what I'm doing. I have setup a child theme and I'm able to edit my child theme style.css and make changes successfully. However I'm unable to enqueue the ...
0
votes
1answer
2k views

Move all the JS files to the bottom|footer, the right way

In order to speedup my site load and prevent scripts from render the page I'm trying to move all the possible scripts (meaning JS files) from head to footer. After read and do some research I made ...
0
votes
1answer
90 views

Enqueuing a stylesheet and ensuring it's loaded before (not after) the theme's stylesheet

In wp_enqueue_style()'s doc I see the third parameter is for stylesheets to be loaded before the one called by the function. But is it possible to do the contrary, meaning to instruct WP to load a ...
3
votes
1answer
90 views

Enqueue a css using negative conditional tags

I'm building a theme on top of purecss.io. In order to make the grid responsive I need to add this stylesheet. From functions.php function load_css() { wp_enqueue_style ( 'purecss-all-not-ie', ...
0
votes
2answers
47 views

wp_enqueue_script stopped working

I'm facing a strange problem. After I've moved to another server, my wp_enqueue_script calls don't do anything. I do have this function: function moemax_scripts() { wp_enqueue_style( ...
0
votes
0answers
18 views

Most optimal way of starting fresh, without using other theme or dropping old files?

I have an unusual situation: A website with very trashed styles.css (thousands of lines of trashy code), around 70+ custom templates, tons of js libraries loaded. First reaction was, lets start fresh ...
0
votes
2answers
241 views

The correct way to include JavaScript and CSS in my WordPress Themes

I'm trying to build my own Wordpress theme using the correct ways. But... The first trouble that I found was how to add css and js "using the correct way". I found severals tutorials how to do it. ...
0
votes
0answers
9 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 ...