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
45 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
27 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
30 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
33 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
74 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' ...
0
votes
1answer
34 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
23 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
43 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
2answers
35 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
24 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
30 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
65 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
25 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
37 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
44 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
40 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() . ...
0
votes
1answer
51 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
26 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 ...
0
votes
0answers
23 views

List all non-admin enqueued files

I am using $wp_scripts and $wp_styles in my admin area to get a list of all css and js files on my site, but only admin registered styles and scripts are being added, I have googled and can't find a ...
0
votes
0answers
44 views

Why is the Dequeue Not Working For All Plugin Styles and Scripts?

I'm trying to increase the load performance a with more sensible loading of admin scripts and styles. I am dequeueing and deregistering scripts and styles where they don't need to be loaded. I've ...
0
votes
2answers
22 views

Faster fonts on mobile

I think I have a great idea to make my site load faster in mobile: "don't load the custom fonts in small screens" I know how to style/change the font used depending on screen size with media queries ...
1
vote
1answer
37 views

Which is the best way to incorporate custom fonts?

I believe there are 3 valid methods of incorporating custom fonts: put a link to them in the header enqueue them in functions.php add them with @font-face in style.css Which is the best way to do ...
0
votes
2answers
39 views

What is the proper way to include Bootstrap when executing a shortcode

I am trying to include bootstrap only when the short-code function executes. It gets included but it affects the other tags of the theme. The only way I can get around this is including bootstrap ...
0
votes
1answer
36 views

Load same stylesheet for front end and wp-admin

How can i load same style sheet for both front end and wp-admin of a wordpress site
0
votes
1answer
26 views

Scripts not loading when using the wp_enqueue_scripts action

Really basic, I'm afraid. My scripts aren't loading when I put them as part of a function triggered by the wp_enqueue_scripts action in functions.php. If I put them outside of that action as part of ...
1
vote
2answers
74 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
77 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
21 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
146 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
17 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
107 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
76 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
51 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?
1
vote
2answers
60 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
32 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
28 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
432 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
124 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
77 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
52 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
36 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
32 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
55 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
110 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
117 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
53 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
42 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
42 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
99 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
309 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 ...