<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Topic: Re-order Head items so Style Sheet call is last</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Fri, 24 May 2013 11:50:03 +0000</pubDate>

<item>
<title>wlanni on "Re-order Head items so Style Sheet call is last"</title>
<link>http://themeshaper.com/forums/topic/re-order-head-items-so-style-sheet-call-is-last#post-16991</link>
<pubDate>Mon, 15 Nov 2010 03:58:52 +0000</pubDate>
<dc:creator>wlanni</dc:creator>
<guid isPermaLink="false">16991@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I should note that the reason for this is to make overriding plugin style sheets easier. If my style sheet shows up after wp_head(), then any plugin style sheets come before mine and I don't have to style with !important
&#60;/p&#62;</description>
</item>
<item>
<title>wlanni on "Re-order Head items so Style Sheet call is last"</title>
<link>http://themeshaper.com/forums/topic/re-order-head-items-so-style-sheet-call-is-last#post-16990</link>
<pubDate>Mon, 15 Nov 2010 03:57:46 +0000</pubDate>
<dc:creator>wlanni</dc:creator>
<guid isPermaLink="false">16990@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hello!&#60;/p&#62;
&#60;p&#62;I'm trying to filter (or hook?) the header so that the thematic_create_stylesheet() call is after wp_head().&#60;/p&#62;
&#60;p&#62;At the moment I just have header.php copied into my childtheme with everything re-ordered. Seems like the simplest fix. However, I'd love to know how to do this using either a filter or a hook (or is that appropriate?)?&#60;/p&#62;
&#60;p&#62;I attempted using an add_filter:&#60;br /&#62;
&#60;code&#62;function my_styles_first() {&#60;br /&#62;
	//move the hook for my style to the last&#60;br /&#62;
	    // Creating the doctype&#60;br /&#62;
    thematic_create_doctype();&#60;br /&#62;
    echo &#34; &#34;;&#60;br /&#62;
    language_attributes();&#60;br /&#62;
    echo &#34;&#38;gt;\n&#34;;&#60;/p&#62;
&#60;p&#62;    // Creating the head profile&#60;br /&#62;
    thematic_head_profile();&#60;/p&#62;
&#60;p&#62;    // Creating the doc title&#60;br /&#62;
    thematic_doctitle();&#60;/p&#62;
&#60;p&#62;    // Creating the content type&#60;br /&#62;
    thematic_create_contenttype();&#60;/p&#62;
&#60;p&#62;    // Creating the description&#60;br /&#62;
    thematic_show_description();&#60;/p&#62;
&#60;p&#62;    // Creating the robots tags&#60;br /&#62;
    thematic_show_robots();&#60;/p&#62;
&#60;p&#62;    // Creating the canonical URL&#60;br /&#62;
    thematic_canonical_url();&#60;/p&#62;
&#60;p&#62;	if (THEMATIC_COMPATIBLE_FEEDLINKS) {&#60;br /&#62;
    	// Creating the internal RSS links&#60;br /&#62;
    	thematic_show_rss();&#60;/p&#62;
&#60;p&#62;    	// Creating the comments RSS links&#60;br /&#62;
    	thematic_show_commentsrss();&#60;br /&#62;
   	}&#60;/p&#62;
&#60;p&#62;    // Creating the pingback adress&#60;br /&#62;
    thematic_show_pingback();&#60;/p&#62;
&#60;p&#62;    // Enables comment threading&#60;br /&#62;
    thematic_show_commentreply();&#60;/p&#62;
&#60;p&#62;    // Calling WordPress' header action hook&#60;br /&#62;
    wp_head();&#60;/p&#62;
&#60;p&#62;    // Loading the stylesheet&#60;br /&#62;
    thematic_create_stylesheet();&#60;br /&#62;
}&#60;br /&#62;
add_filter( 'get_header', 'my_styles_first' );&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Then I attempted to unhook the thematic_create_stylesheet completely so I could add it after wp_head... but I wasn't sure how I'd do that either. Anyway, this didn't work so I gave up:&#60;br /&#62;
&#60;code&#62;function unhook_stylesheet_position() {&#60;br /&#62;
	//remove custom style sheet&#60;br /&#62;
	remove_action('get_header','thematic_create_stylesheet');&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;add_action('init','unhook_stylesheet_position');&#60;/code&#62;
&#60;/p&#62;</description>
</item>

</channel>
</rss>
