Should use wp_enqueue_style
-
instead of
// Add a header hook so we can link to a CSS file add_action('wp_head', 'most_shared_posts_head'); // Our header function which'll hook in our CSS file function most_shared_posts_head() { echo '<link rel="stylesheet" type="text/css" href="' . plugins_url('most-shared-posts.css', __FILE__). '">'; }shouldn’t you use
// Add a header hook so we can link to a CSS file add_action('wp_enqueue_scripts', 'most_shared_posts_style'); // Our header function which'll hook in our CSS file function most_shared_posts_style() { wp_enqueue_style( 'most-shared-posts', plugins_url('most-shared-posts.css', __FILE__) ); }
The topic ‘Should use wp_enqueue_style’ is closed to new replies.