WordPress.org

Ready to get started?Download WordPress

Forums

d3 simplecharts
Use wp enqueue style to add css to header (4 posts)

  1. cheche
    Member
    Posted 1 year ago #

    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/

  2. Jouni Santara
    Member
    Plugin Author

    Posted 1 year ago #

    This is quite interesting - I take a closer look by tomorrow about your suggestions.

    What is your environment by the way (OS/browser) ?

  3. Jouni Santara
    Member
    Plugin Author

    Posted 1 year ago #

    Btw, I sent you further info by email - check that out.

  4. cheche
    Member
    Posted 1 year ago #

    I use Debian/Iceweasel(Firefox) 20.0. I will reply to you later

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic