0

I am using this

<?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' );

}
add_action('wp_enqueue_scripts', 'theme_styles');
?>

to add a stylesheet in my theme, but it's not loading the stylesheet

  • Are you using a parent theme or a child theme – Pieter Goosen Jul 19 '14 at 8:23
  • i Am developing my Own Theme. Btw what is meant by parent and child theme ? – JAWA Jul 19 '14 at 8:25
  • Check here – Pieter Goosen Jul 19 '14 at 8:27
  • No i am not using any child theme – JAWA Jul 19 '14 at 8:29
0

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' );

    }
    add_action('wp_enqueue_scripts', 'theme_styles');
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.