WP Plugin CSS not being applied to page

I am making a shortcode plugin that sends a variable to a JS script.
Everything is working except the CSS is not being applied to the page with the shortcode or any other page. Any idea to fix this, please? The CSS link does exist in the page source when I checked.

add_action( ‘wp_enqueue_scripts’, ‘register_scripts’ );

function register_scripts() {
wp_register_script( ‘NN’, plugins_url( ‘main.js’, __FILE__ ),
‘jquery’, 0.01, true );
wp_register_style( ‘namespace’, plugins_url( ‘main.css’, __FILE__ ),
‘css’, 0.03, true );

add_shortcode( ‘Now’, ‘my_handle_shortcode’ );

add_action( ‘wp_enqueue_scripts’, ‘load_javascript’ );

function load_javascript() {

wp_localize_script( ‘NN’, ‘NN’, array( ‘text’ => $NN ) );

function my_handle_shortcode() {

return ‘
<div id=”inner”>
<span ></span>
wp_enqueue_script( ‘NN’ );


} //end load js –>

Read more here:: WP Plugin CSS not being applied to page

Leave a Reply

Your email address will not be published. Required fields are marked *