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

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