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

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

1 Answer 1

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 and acknowledge you have read our privacy policy.

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