wp_enqueue_scripts hangs

I’m not sure you can use is_page() in the function.php (citation needed!). Instead of enqueuing the the style sheets, you could echo them in the header.php. So, in the header.php you’d want… <?php if ( is_front_page() ) { echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . get_template_directory_uri() . ‘/css/homepage.css”>’; } else if ( is_page( ‘corsi’ ) ) … Read more

wp_enqueue doesn’t load dependencies

You have to define the dependencies for either styles or scripts when you register them. Or, if you’re avoiding the registration completely, then it’s ok to stuff them into the queueing process. See more on the Codex page. wp_register_style( ‘reset’, get_template_directory_uri().’/reset.css’ ); wp_register_style( ‘style’, get_template_directory_uri().’/style.css’, array( ‘reset’ ) ); wp_enqueue_style( ‘style’ ); Also avoid single … Read more

wp_enqueue_style url is trimmed somehow

Based on the ID attribute id=’ai1ec_style-css’ that stylesheet is for All-in-One Event Calendar plugin. If you just updated the All_in-One Event Calendar (the most recent update was yesterday 2013-8-16) try re-saving the calendar theme options in Events->Theme Options. This answer is based on this support topic. http://wordpress.org/support/topic/broken-links-inside-plugin-after-updating-to-196

wp add inline style in loop

If grid_init() runs inside the Loop, then it executes after the page head and after the associated hooks– wp_head, wp_enqueue_scripts, etc. PHP executes line by line in sequence, so if you miss a hook you just missed it. You can’t go backwards. The script/style enqueueing subsystem does have to ability to put things int he … Read more

How to add php stylesheet to admin section instead of admin_head hook

If you enqueue your style sheet first you should be able to use wp_add_inline_style afterwards. function custom_style() { wp_enqueue_style(‘your_css’, plugin_dir_url( __FILE__ ) . ‘style/your_css.css’ ); $bg_color = get_option(‘custom_color’); $custom_css = ” body { background-color: {$bg_color}; }”; wp_add_inline_style( ‘your_css’, $custom_css ); } This is not tested (just written from mind) and I have never used it … Read more