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
版权声明:本文标题:wp enqueue style - Creating a WP plugin and having issues linking CSS stylesheet within functions 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741308221a2371495.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论