Support » Plugin: Custom About Author » Enqueue CSS Correctly

  • Resolved Jon Brown

    (@jb510)


    wp_enqueue_style() isn’t hooked correctly

    custom-about-author.php:41

    change out to:

    // Enqueue plugin style-file
    add_action( 'wp_enqueue_scripts', 'caa_add_my_stylesheet' );
    function caa_add_my_stylesheet() {
    	wp_enqueue_style('cab_style', $caa_plugin_dir_path.'/cab-style.css');
    }

    then no more debug errors 🙂

    http://wordpress.org/extend/plugins/custom-about-author/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Oops, didn’t notice you’re using a var for the path.

    Should be:
    // Enqueue plugin style-file
    add_action( ‘wp_enqueue_scripts’, ‘caa_stylesheet’ );
    function caa_stylesheet() {
    wp_enqueue_style(‘cab_style’, plugins_url(‘/cab-style.css’, __FILE__) );
    }

    (that’s actually tested and working)

    Plugin Author edwinkwan

    (@edwinkwan)

    Thanks Jon Brown,

    I’ve added the change to version 1.5.3

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Enqueue CSS Correctly’ is closed to new replies.