Articles of wp enqueue style

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 WP site. I created a calculator.php page template and put my .html […]

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: add_action(‘wp_enqueue_scripts’,’dlm_scritps_init’); function dlm_scritps_init() { wp_enqueue_script( ‘dlm-scripts’, plugins_url( ‘data-layer-plugin/js/dlm-window.js’, __FILE__ )); } Esstinally what i need the JavaScript file todo is when this button is […]

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?

@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 like below: @font-face { font-family: ‘roboto_condensedregular’; src: url(‘fonts/RobotoCondensed-Regular-webfont.eot’); src: url(‘fonts/RobotoCondensed-Regular-webfont.eot?#iefix’) format(’embedded-opentype’), url(‘fonts/RobotoCondensed-Regular-webfont.woff’) format(‘woff’), url(‘fonts/RobotoCondensed-Regular-webfont.ttf’) format(‘truetype’), url(‘fonts/RobotoCondensed-Regular-webfont.svg#roboto_condensedregular’) format(‘svg’); font-weight: normal; font-style: normal; } It’s working fine, but in […]

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 wp_register_script() and wp_enqueue_script() functions. Here is my code in the child theme’s functions.php file: function custom_scripts() { wp_enqueue_style( ‘steedicons’, get_stylesheet_directory_uri() […]

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. However, the 2 add_action calls are not firing: //Register Styles add_action( ‘wp_enqueue_style’, array( $this, ‘register_styles’ ) ); //Register Scripts add_action( […]

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 cant move it into plugin, as soon as i move it into plugin it wont work. currently […]

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: define(‘STENT_PLUGIN_URL’,plugins_url(”, __FILE__ )); add_action(‘after_setup_theme’,’stent_setup’); function stent_setup() { (…) add_action( ‘admin_enqueue_scripts’, ‘stent_load_admin_scripts’ ); } function stent_load_admin_scripts() { var_dump(STENT_PLUGIN_URL); // Debugging to […]

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 in my header.php. <?php if( is_page_template(‘background-slider-template.php’) ) { ?> <link rel=”stylesheet” […]

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 ( ‘themes.php?page=page-name’ != $hook ) { return; } wp_enqueue_style( ‘custom-style’, get_template_directory_uri() . ‘custom-page/style.css’ ); } add_action( ‘admin_enqueue_scripts’, ‘my_function’ ); As you can see […]