WordPress.org

Ready to get started?Download WordPress

Forums

Custom About Author
[resolved] Enqueue CSS Correctly (3 posts)

  1. Jon Brown
    Member
    Posted 1 year ago #

    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/

  2. Jon Brown
    Member
    Posted 1 year ago #

    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)

  3. edwinkwan
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks Jon Brown,

    I've added the change to version 1.5.3

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.