Enqueueing Scripts and Styles

I think you are using the wp_enqueue_style the wrong way as it is not an action hook. wp_enqueue_scripts action hook is being used for enqueuing both scripts and styles. try this: function my_scripts_method() { wp_deregister_script( ‘jquery’ ); wp_deregister_script( ‘style’ ); wp_register_script( ‘jquery’, ‘//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js’ ); wp_register_style(‘style’, ‘//siteripe.com/style.css’ ); wp_enqueue_style(‘style’); } add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’);

enqueue_parent_style

I think if you change your wp_enqueue_style to the one below it will work perfectly. This is the way I do it inside my own functions.php file. function wpse_scripts() { // Theme Stylesheet wp_enqueue_style(‘style’, get_stylesheet_uri()); } add_action(‘wp_enqueue_scripts’, ‘wpse_scripts’); Although you can do it the way your doing it, it’s just you’ve added a / before … Read more

different style sheet for just one page template

The preferred way is to use add_action( ‘wp_enqueue_scripts’, ‘themeslug_enqueue_style’ ); within your child theme functions.php file or directly in your referral.php template page. Either way, it’s by using add_action and not by echoing into the <link> tag. Registering your style is also a recommended practice. The one benefit I would see in your case is … Read more

stylesheet in header or functions?

wp_enqueue_style has a 5th parameter that represents the media attribute. https://developer.wordpress.org/reference/functions/wp_enqueue_style/ You could do the following to load this correctly: wp_enqueue_style( ‘stylecss’, get_stylesheet_uri(), array(), false, ‘screen’ ); Hope it helps!

Child theme stylesheet not always overriding “index”

wp_enqueue_style( $parent_style, get_stylesheet_directory_uri() . ‘/style.css’ ); wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( $parent_style ), wp_get_theme()->get(‘Version’) ); Look closer, specifically at the URLs you passed to enqueue style: parent: get_stylesheet_directory_uri() . ‘/style.css’ child: get_stylesheet_directory_uri() . ‘/style.css’ They’re identical, they’re the same file, that’s the problem. Your child themes stylesheet isn’t overriding the parent, because the parent … Read more