Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
276 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, ...
1 vote
2 answers
2k views

Relative path in wp_register_style not working

I have this function: function test_add_my_stylesheet() { wp_register_style( 'test-admin-style', plugins_url('../css/style.css', __FILE__) ); wp_enqueue_style( 'test-admin-style' ); } but ...
5 votes
1 answer
9k 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
1 answer
174 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
1 answer
1k 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 ...
2 votes
2 answers
2k 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. e....
1 vote
1 answer
180 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 ...
1 vote
1 answer
2k 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: &...
0 votes
0 answers
286 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, ...
0 votes
2 answers
2k 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 ...
1 vote
1 answer
506 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
1 answer
2k 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. (...
3 votes
1 answer
294 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 ...
16 votes
4 answers
9k 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', add_query_arg(...
0 votes
1 answer
1k 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
0 answers
130 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 (...
0 votes
2 answers
943 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
2 answers
2k 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
2 answers
140 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: * ...
5 votes
2 answers
3k 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/ ...
2 votes
1 answer
5k 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', get_template_directory_uri()...
1 vote
1 answer
115 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
2 answers
140 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 ...
0 votes
0 answers
125 views

Replacing parent theme's IE-specific CSS

I'm trying to do exactly what was apparently achieved in this discussion. However, I'm finding that my IE-specific stylesheet's being loaded all the time! My parent theme includes this in its ...
1 vote
4 answers
6k views

enqueue_style is not working

I try to load the main stylesheet with enqueue_style - but it isn't working. Here is my code from functions.php: function my_scripts() { wp_enqueue_style( 'main-style', ...
1 vote
3 answers
318 views

To enqueue or not to enqueue

What is the best way to link to a CSS file in WordPress? Method 1: Use the following whenever needed <link href="<?php echo get_template_directory_uri(); ?>/my-style.css" rel="stylesheet" ...
22 votes
2 answers
1k views

Is it ever okay to include inline CSS in plugins?

Normally in a plugin I would add styles using wp_enqueue_style. However, I am currently creating a plugin that only needs a few lines of CSS and I am wondering if it might be better to serve the ...
4 votes
1 answer
2k views

How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?

How would I go about combining multiple CSS files and concatenating my scripts if they're being enqueued as WordPress recommends? My site is pretty slow and would like to optimize for performance.
1 vote
1 answer
13k views

get_stylesheet_uri returns wrong path

I am using the roots theme. Inside scripts.php, the stylesheets are loaded using the wp_enqueue_style-function. wp_enqueue_style('roots_bootstrap', get_template_directory_uri() . '/assets/css/...
0 votes
2 answers
624 views

Display Something in the Header After All Styles are Loaded

I'd like to include a functionality in a theme that will overwrite styles from previously included CSS files. For this purpose, I need to be able to display a <style> in the header after ALL ...
1 vote
2 answers
205 views

Why are my styles being applied to the admin area?

All my enqueued styles are applied to the back-end as well. I have never encountered this behavior before. Here's my code: wp_register_style( 'main-styles', get_stylesheet_directory_uri() . '/css/...
1 vote
1 answer
141 views

Fixed layout for admin section

I would like to customize the layout of the admin section of WordPress. The thing is, whatever the layout I create, I'm very dependent of the default "fluid" layout of the admin. By fluid, I mean: ...
1 vote
1 answer
2k views

Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]

Possible Duplicate: How can I use WordPress functions in my stylesheet? I have a file, custom.php, thats basically a stylesheet with php variables for the styles. I used this guide to make it but ...
0 votes
2 answers
154 views

How do I use a color from theme options?

I am building a theme, and in the options I have created a place for link color. I cant seem to get this into the theme in any reasonable way. The best I can do is to put it after wp_head ... but that ...
1 vote
1 answer
3k views

Custom Admin CSS styles to style media uploader?

Hopefully a simple answer to this. Using the wp custom header feature, the media upload screen shows an extra field: "set as header". I'm trying to make this text bigger as it can easily be missed. ...
0 votes
1 answer
343 views

Having issue with WordPress wp_enqueue_style

I am building a full design into WordPress for the first time and I am trying to load in stylesheets and script files but all I seem to be getting is the text output of the location. What I have is ...
2 votes
1 answer
5k views

Enqueue styles after a plugin

Is there a way to enqueue my style.css (and other stylesheets) AFTER a certain plugin enqueues its styles? Specifically, I want my style.css to overwrite cforms's styles, but when I change the ...
20 votes
3 answers
4k views

How important is it to enqueue a theme's stylesheet?

I have trawled the net looking for an answer to this, but for some reason all I can find are actual examples, but without that particular explanation, which is clear say in the case of scripts. Can ...
0 votes
1 answer
374 views

CSS not being applied using wp_enqueue_style

I am trying to load my style sheets in my plugin but they are not being called, the javascript files however, are being loaded. <?php /** Plugin Name: Plugin URI: Description: Version: Author: ...
3 votes
1 answer
354 views

TinyMCE custom stylesheets for different post types

I use a custom stylesheet for TinyMCE, by placing custom styles in editor-style.css in my theme's directory. I am trying to figure out how to use a different stylesheet depending on what post type we ...
1 vote
1 answer
2k views

How do I make header.php use different css for different pages?

I register styles in function.php with function my_scripts() { wp_deregister_style( 'header' ); wp_register_style( 'header', get_template_directory_uri() . '/css/header.css' ); ...
0 votes
1 answer
2k views

Use conditionals with wp_enqueue_style to attach stylesheet according to post type displayed

I have many custom post types, including some introduced by plugin such as bbPress or WooCommerce. My standard stylesheet is growing large, so I thought to split it into multiple stylesheets ...
2 votes
2 answers
2k views

getting url in wp_enqueue_style

I'm having trouble getting the second argument in wp_enque_style. Here's how my site is setup: style.css custom_style.css index.php In a template, I have this code: $stylesheet_url = bloginfo('...
1 vote
1 answer
3k views

wp_enqueue_style in Plugin [duplicate]

Possible Duplicate: Where is the right place to register/enqueue scripts & styles When I enqueue a css style in a plugin like so: function add_my_stylesheet() { wp_enqueue_style( '...
0 votes
1 answer
577 views

Enqueuing a script before anything else

I wondered if it was possible to change the order in which a script is enqueued. I ask this because I wish to include the HTML5 enabling script but it needs to be included before any styles. Is ...

1 2 3
4