admin管理员组

文章数量:1287489

Creating a WP plugin for third party usage (first time doing this), and typically links to stylesheets are put in the header or in the theme generated options panel. That's fine for personal use but not for this.

I found wp_enqueue_style via a search on here, and I'm trying to apply it. Below is the code I have right now.

function wpse_load_plugin_css() {
    $plugin_url = plugin_dir_url( __FILE__ );

    wp_enqueue_style( 'style', $plugin_url . 'style.css' );
}
add_action( 'wp_enqueue_scripts', 'wpse_load_plugin_css' );




function test() {
global $con;
wp_enqueue_style('style');

   ** the bulk of my code - query and output **

}

None of my styling is working at this point. I've cleared the cache, and this early stage, just trying to change the size of fonts.

EDIT: Directory: /wp-content/plugins/player-match/

Both functions are on the same file pm_main.php. style.css is in the same directory.

Am I on the right track?

Thank you.

本文标签: wp enqueue styleCreating a WP plugin and having issues linking CSS stylesheet within functions