Support » Plugin: HootProof Like Box » Proper loading of styles

  • Hey Michelle,

    using your plugin with WP_DEBUG on true throws some general error messages due to the implemented call on the enqueued styles. You should wrap the following lines in a function and hook it into an action.

    wp_register_style('htprfb_like_box_css', HTPRFB_PLUGIN_PATH . 'style.
    wp_enqueue_style('
    wp_register_style('htprfb_fontawesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.
    wp_enqueue_style('htprfb_fontawesome');

    For example hook it into ‘wp_enqueue_scripts’ as Codex suggests or how I prefer into ‘wp_head’:

    add_action( 'wp_head', 'htprfb_load_styles' );
    /**
     * Action hook to load Plugin specific Stylesheets.
     *
     * @since 1.2.2
     *
     * @uses HTPRFB_PLUGIN_PATH
     *
     */
    function htprfb_load_styles(){
    
    	wp_register_style('htprfb_like_box_css', HTPRFB_PLUGIN_PATH . 'style.css');
    	wp_enqueue_style('htprfb_like_box_css');
    	wp_register_style('htprfb_fontawesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css');
    	wp_enqueue_style('htprfb_fontawesome');
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Proper loading of styles’ is closed to new replies.