How to add styling and script to a custom widget plugin

You can use wp_enqueue_script and wp_enqueue_style just after the following code add_action(‘widgets_init’, function(){ register_widget(‘calendar_widget’); }); You can add js/css like this function mg_scripts() { wp_enqueue_style( ‘style-name’, ‘/path/to/css’ ); wp_enqueue_script( ‘script-name’, ‘/path/to/js’, array(), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘mg_scripts’ ); You can also call wp_enqueue_script and wp_enqueue_style directly inside widget function like this <?php /* … Read more

how to add custom css at top above all css file for specific url

/** * Enqueue stylesheet before others */ class EnqueueStylesheetEarly { function __construct() { add_action( ‘wp_enqueue_scripts’, [ $this, ‘load_before_other_stylesheets’ ], 5 ); } /** * Register and enqueue stylesheet */ function load_before_other_stylesheets() { wp_register_style( ‘bootstrap-css’, plugin_dir_url( __FILE__ ) . ‘bootstrap.min.css’, [], ‘3.3.7’ ); wp_enqueue_style( ‘bootstrap-css’ ); } } Then you can load this with your other … Read more

jQuery to show icon after .hide

I assume the different spellings of .simplelightbox and .simple-lightbox are typos in your question and both are correct in your code. My first thought would be to find the function in the plugin that is fired when the white ‘X’ is clicked (that closes the lightbox) and add your line of code. If you don’t … Read more

Create Biographies

A couple of notes here: You might find a custom post type to be better than using a built-in Page. You would create a post type called something like “players” or “football-players” and with it you’d have an archive. Very similar to how Posts and Categories work: you’ll have one URL for each Post but … Read more