1 wordpress plugin development header and css file enqueue
1.plugin header and css file enqueue
=======================================================================
<?php
/**
* Plugin Name: Nice WP Testimonial
* Plugin URI: https://wordpress.org/plugins/nice-wp-testimonial/
* Description: Nice WP Testimonial is a wordpress plugin to display your client review or
testimonial in your wordpress website.
* Version: 1.0
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: Zakir BD
* Author URI: https://developerzakir.blogspot.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: nwpt
* Domain Path: /languages
*/
/**
* Proper way to enqueue scripts and styles
*/
function nwpt_plugin_scripts() {
wp_enqueue_style( 'owl.carousel', 'https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.css' );
wp_enqueue_style( 'owl.theme', 'https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.theme.min.css' );
wp_enqueue_style( 'nwpt-css', plugins_url( 'css/nwpt-style.css', __FILE__ ) );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'nwpt_plugin_scripts' );
...............................
No comments