Support » Plugin: d3 simplecharts » Use wp enqueue style to add css to header

  • according to:
    http://codex.wordpress.org/Function_Reference/wp_enqueue_style

    Please review this code as a better way to add style files on the plugin.

    function d3simplecharts_add_stylesheets() {
            wp_register_style( 'nv.d3-style', plugins_url('nvd3/nv.d3.css', __FILE__) );
            wp_enqueue_style( 'nv.d3-style' );
            wp_register_style( 'd3chart-style', plugins_url('d3chart.css', __FILE__) );
            wp_enqueue_style( 'd3chart-style' );
            wp_register_style( 'query-ui-style', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css' );
            wp_enqueue_style( 'query-ui-style' );
            wp_register_style( 'rickshaw.min-style', plugins_url('rickshaw/rickshaw.min.css ', __FILE__) );
            wp_enqueue_style( 'rickshaw.min-style' );
        }
    
    add_action( 'wp_enqueue_scripts', 'd3simplecharts_add_stylesheets' );

    http://wordpress.org/extend/plugins/d3-simplecharts/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use wp enqueue style to add css to header’ is closed to new replies.