Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-register-style]

The tag has no usage guidance.

0
votes
1answer
32 views

How to disable all css from the theme for a specific post type page

I´m creating a plugin and I need, when the admin is logged in and a single-{post-type-slug}.php does not exist, the page https://my-site/post-type-slug/my-admin-page.php can be displayed without ...
0
votes
0answers
246 views

How to remove Google fonts from wp-admin (Roboto) added by core

This line is in source of /wp-admin/ code. I do not wish to have extra Google fonts in Wordpress admin area. <link rel='stylesheet' id='prefix-style-css' href='https://fonts.googleapis.com/css?...
0
votes
3answers
284 views

Apply function only if end of url has /amp/

I applied a filter to remove all theme styles, but I want this to happen only if the url ends with /amp/. The code below is removing the .css styles on all pages, not filtering the term /amp/ of the ...
0
votes
0answers
13 views

How to set multiple user role in single registration page

This is a login/register page of jobroller theme. I want same login/register page with wordpress twenty-sixteen theme. I am kinda noob in this. How can i do this without using the jobroller theme?
0
votes
1answer
40 views

Edit CSS of a plugin

I'd like to edit a CSS file that is located at wp-content/plugins/woocommerce-gateway-stripe/assets/css/stripe-styles.css, I tried to overwrite it by placing the edited css in my child theme at wp-...
-2
votes
2answers
51 views

How to create my own style.css file in an wordpress child-theme

I am working in the theme called Understrap. I work in the child-theme. The theme allready has a style.css and functions.php. I want to create my own style.css file and overwrite that style.css ...
1
vote
1answer
272 views

wp-login.php register/lost password links to buttons?

How do I style the wp-login.php register/lost password links to buttons for an easier mobile UI? Where do I find the HTML to append the ahref to a submit? And which CSS file do style that button in? ...
0
votes
1answer
244 views

I can't add CSS with functions.php [SOLVED]

I'm relatively new to creating a theme with WordPress, and I've been adding all the stylesheets (main and for each page) with the old echo get_stylesheet_uri();. But I find out that this isn't the ...
0
votes
1answer
23 views

my custom css file downloads then it STOPS!

I’m watching an online course for WordPress development and at the beginning I attached the css file the exact like what the instructor did and tested it by adding some styles and it worked fine ...
0
votes
0answers
1k views

Visual composer addon load javascript/css only on pages using the addon

I am creating an addon for Visual Composer through vc_map and I am adding the javascript/css scripts needed by my addon to work on the website pages through /* Load plugin css and javascript files ...
1
vote
1answer
565 views

Best spot for wp_register_script() and wp_register_style()

I need to enqueue multiple scripts and styles in my plugin. However, I do not like the idea of calling wp_register_script() and wp_register_style() every time I need to call wp_enqueue_script() and ...
2
votes
0answers
90 views

wp_deregister_style with md5 variable?

I want to deregister Google Fonts to defer the loading. The style id is dynamic. wp_enqueue_style( 'theme-google-fonts-' . md5( $google_font_url ), $google_font_url, array() ); How can I deregister ...
0
votes
1answer
243 views

Custom register_taxonomy ins't showing custom Nav menu

i am using wordpress custom post and register_taxonomy bellow is my code . function epg_works_register() { $labels = array( 'name' => __('Works'), 'singular_name' => __('Works'), ...
0
votes
1answer
397 views

Missing dns-prefetch link when using “nested” wp_register_style

Given this script: function register_styles(){ wp_register_style('google-fonts', '//fonts.googleapis.com/css?family=Oswald|Open+Sans'); wp_register_style('bootstrap', ...
1
vote
2answers
256 views

Font Awesome changing default WordPress Font

I have a WP Plugin where i use Font-Awesome Icons. I added the Font-Awesome folder to my Plugin Files and told WordPress to use them: // add font-awesome to admin area function ecp_admin_enqueue($...
0
votes
1answer
3k views

wp_enqueue_scripts does not work

I am creating a theme for Wordpress, but the wp_enqueue_scripts does not work. The code that is in functions.php is: <?php function scripts_and_styles() { if ( ! is_admin() ) { ...
2
votes
1answer
134 views

I register and enqueue stylesheet but nothing is rendered

I'm told it's very important to register and enqueue styles and scripts in WordPress even though it's a real pain. I had no problem with the scripts however when I try the styles, WordPress shows ...
0
votes
2answers
805 views

Dequeue, Unregister, Remove Action - Not Working on Plugin

Several years ago, not really having a handle on the best practice for running a MultiSite network, I often network activated plugins. Later I realized this was a mistake because not all the sites ...
0
votes
1answer
125 views

WordPress Register Style Called Incorrectly

Why am I getting this error? Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or ...
1
vote
3answers
734 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
39 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
98 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 ...
2
votes
2answers
1k 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....
0
votes
2answers
493 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 ...
51
votes
7answers
31k views

Enqueue Scripts / Styles when shortcode is present

What is the idea way to register/enqueue scripts and/or styles for use in plugins? I recently made a plugin simple plugin to add the user avatar/gravatar with a shortcode. I have different style ...
2
votes
1answer
2k 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: ...
1
vote
2answers
2k 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 ...
1
vote
1answer
4k views

Using wp_register_style to load CSS in footer?

I realise you can enqueue JS in the footer using wp_register_script as there is a $in_footer parameter for doing so. However, there isn't one for wp_register_style it seems. Is there a way to enqueue ...
0
votes
1answer
1k 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
84 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" ...
1
vote
0answers
101 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 (...
2
votes
1answer
4k 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()...
16
votes
1answer
15k 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 that'...
0
votes
2answers
1k 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 ...
0
votes
2answers
638 views

How to dequeue css files?

I have bought a theme, but on a particular page i don't want to use the theme js/css files. The theme registers the files like function add_our_scripts() { global $post; $options = ...
0
votes
1answer
70 views

Style file inclusion

I am trying to include a flexslider.css file with this code: wp_register_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' ); if( is_page( 'home' ) ) { wp_enqueue_style( '...
2
votes
1answer
114 views

Naming script handles right way

I was wondering is there any convention or what is the right way for naming handles in wp_register_script() and wp_register_style() functions? For example if I am developing a plugin that uses ...
5
votes
3answers
3k 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
682 views

wp_enqueue doesn't load dependencies

I'm trying to load style.css but rest.css should be included first. I don't understand why reset.css is not included function addMyScript() { wp_register_style('style', get_template_directory_uri(...
1
vote
1answer
6k views

WP deregister, register and enqueue dequeue

a plugin that I bought is loading a few js and css files on all pages, so I wanted to write a new function to deregister the handles, and enqueu them where I wanted. however I am not sure If I have to ...
0
votes
1answer
374 views

Change path/url of admin-bar.min.css

Does anyone know where admin-bar.min.css is registeded/included? Im trying to add a slash in front of admin-bar.min.css, so the admin bar will work correctly on all pages. Im playing arround with a ...
9
votes
1answer
19k views

How to enqueue style before style.css

How do I enqueue a .css file before style.css is loaded? Or make the default style.css dependant on another .css file? I'm trying to load a .css reset, which style.css would overwrite. Here's what I ...
4
votes
1answer
13k views

How do I register/enqueue a custom CSS file?

Good Day. I am using a Wordpress theme and I want to add my own custom CSS. Now I have tried adding my own separate stylesheet after all the other php stylesheet calls in the header.php file. I tried ...
1
vote
1answer
1k views

Register script/style: Is it possible to customize the version query string via plugin?

Expanding on the question in the title: I would like to find a way (via a plugin) to use timestamps for the JS and CSS file version query strings that are output with wp_register_style and ...
-1
votes
1answer
661 views

wp_register_script and wp_register_style when shortcode is used

hi so I used a great tutorial off of http://scribu.net/wordpress/optimal-script-loading.html and I am having trouble loading the scripts when a shortcode called lightbox is used here is my code. I am ...
0
votes
1answer
3k views

Deregister a CSS file that comes with a plugin

WPML plugin comes with its own CSS file. I want to get rid of all the CSS it contains, so I put everything between /* */. However I'll have to do that again when I'll update the plugin. Is there a way ...
0
votes
1answer
1k 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 ...
6
votes
2answers
4k views

Load js/css files only on specific admin UI pages

How do I adapt this solution to work with my plugin? (Please see the link). I enqueue my css and js script as follows: function my_plugin_init() { wp_enqueue_script('my_plugin_script', plugins_url('...
0
votes
1answer
96 views

Need some PHP schoolin'! passing var to url and the old options table

So, I've been building a theme options page, one of the purposes of which is to get some style values to pass to my php stylesheet in the url. Here's what I have: /* Get all theme settings */ ...
43
votes
1answer
9k views

Where is the right place to register/enqueue scripts & styles

I am using WordPress 3.1.4 by now. I am confused with where (which hook) do I use: to register and/or enqueue scripts and styles on front- and back-ends? Questions: Which are right hooks to use? ...