[wp-hackers] Theme Development: load stylesheet with wp_enqueue_style

Guido WP guido at wp-butler.com
Sat Sep 21 07:50:07 UTC 2013


Hi all,

I'm developing my first (simple) WP Theme and I want to load the main stylesheet with wp_enqueue_style in functions.php.

function my_scripts() {
      wp_enqueue_style( 'main-style', get_template_directory_uri() . '/style.css', false, '1.0', 'all' );
      }
add_action( 'wp_enqueue_scripts', 'my_scripts' );

I tried also get_stylesheet_uri() or get_stylesheet_directory_uri() . '/style.css' instead of get_template_directory_uri.

If I load the stylesheet in the header.php by using a link tag everything is fine.
The file is there, the get_template_directory_uri() function points to the right place - I tested it out by using echo command in frontpage.php

I checked the apache logs, and the wp-logs - there are no error messages.

I don't no where to start further analysis ?

If I use another theme (e.g. twenty thirteen) the functions works - it's the same way the stylesheet is loaded.
That means to me the system is o.k. -  there must be something wrong with my theme.

Are there any tools to analyze the execution process at the php site or set some breakpoints or create some log entries?

Thank you very much for a hint or advise.

Regards, Guido




More information about the wp-hackers mailing list