Unable to load stylesheet via wp_enqueue_style

Yo have not opened the php tag correctly in the beginning of your snippet. try adding at least one space after <?php and right before the first //: <?php // Load the theme stylesheets function theme_styles() { // Load all of the styles that need to appear on all pages wp_enqueue_style( ‘main_css’, get_template_directory_uri() . ‘/style.css’ … Read more

Different styles on multiple pages

You can use elseif to check another page template and you can go on like this. if ( is_page_template(‘page-templates/page-1.php’) ) { wp_enqueue_style( ‘sentiencesentient-layout-style’ , get_template_directory_uri() . ‘/layouts/style1.css’); } elseif ( is_page_template(‘page-templates/page-2.php’) ) { wp_enqueue_style( ‘sentiencesentient-layout-style’ , get_template_directory_uri() . ‘/layouts/style2.css’); } elseif ( is_page_template(‘page-templates/page-3.php’) ) { wp_enqueue_style( ‘sentiencesentient-layout-style’ , get_template_directory_uri() . ‘/layouts/style3.css’); } elseif ( is_page_template(‘page-templates/page-4.php’) … Read more

custom template – override plugin template in child theme – issue with scripts

Please Provide Proper path to enqueue scripts and styles Example- function theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ ); then it will work fine

Why won’t my Custom CSS Load

hey please include style sheet like this <?php add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_style’ ); function enqueue_parent_theme_style() { wp_enqueue_style( ‘parent-style’, get_stylesheet_uri() ); } and also stylesheet not require to load jQuery so please change your code to like this if ( ! function_exists( ‘add_additional_css’ ) ) { function add_additional_css() { wp_enqueue_style( ‘webmarket-child’, get_stylesheet_uri() , array( ‘main’ ) ); … Read more

wp_enqueue_script stopped working

I’m not sure what the problem would be, but I’d start out by checking to see if they are actually getting enqueued. http://codex.wordpress.org/Function_Reference/wp_script_is That would at least let you know if you have a declaration problem of if there is something wrong when enqueued scripts are being drawn. (like a plugin conflict or some such)

Modify arguments for parent theme’s `wp_register_style` via child theme

I don’t think there’s a built-in safe way to do this, but you could directly modify the $wp_styles global after things are registered but before they’re output, or at least use it to fetch the parameters a style was originally registered with. global $wp_styles; if( isset( $wp_styles->registered[‘a_stylesheet’] ) ){ $wp_styles->registered[‘a_stylesheet’]->args=”handheld”; } Not ideal, but it … Read more