<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sivel.net &#187; Questions</title>
	<atom:link href="http://sivel.net/category/questions/feed/" rel="self" type="application/rss+xml" />
	<link>http://sivel.net</link>
	<description>Throwing Hot Coals</description>
	<lastBuildDate>Tue, 17 Jan 2012 22:32:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Detect wp_head and wp_footer from a Plugin</title>
		<link>http://sivel.net/2010/04/detect-wp_head-and-wp_footer-from-a-plugin/</link>
		<comments>http://sivel.net/2010/04/detect-wp_head-and-wp_footer-from-a-plugin/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 20:36:45 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[CoolStuff]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Questions]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sivel.net/?p=948</guid>
		<description><![CDATA[Normally I start these posts with &#8220;Every so often someone asks a question in the WordPress IRC channel that sparks my interest&#8221;, however today, to my great surprise someone actually caught my attention on the wp-hackers mailing list. For those &#8230; <a href="http://sivel.net/2010/04/detect-wp_head-and-wp_footer-from-a-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Normally I start these posts with &#8220;Every so often someone asks a question in the WordPress IRC channel that sparks my interest&#8221;, however today, to my great surprise someone actually <a href="http://lists.automattic.com/pipermail/wp-hackers/2010-April/031683.html">caught my attention</a> on the <a href="http://lists.automattic.com/mailman/listinfo/wp-hackers">wp-hackers</a> mailing list.</p>
<p>For those of you who didn&#8217;t click through, the question was:</p>
<blockquote><p>
Couldn&#8217;t find this on forums or anywhere else.<br />
What can I test to check if wp_footer was placed on the theme?
</p></blockquote>
<p>Before any replies came in I was already interested and when <a href="http://blog.ftwr.co.uk">Peter Westwood</a> replied with &#8220;The other way to do it is to do a http request based test which a special query arg on which you output a string on wp_footer.&#8221;, I was on the hook.</p>
<p>I spent a few minutes writing up a test plugin, to perform only this functionality and responded back to the list.  It was pretty well accepted and I got a few comments from <a href="http://planetozh.com">Ozh</a> and <a href="http://www.andrewnacin.com/">Andrew Nacin</a> on Twitter.  One of the comments was actually an idea, to extend the checks to make sure that the calls to <code>&lt;?php wp_head(); ?&gt;</code> and <code>&lt;?php wp_footer(); ?&gt;</code> were in the proper places in the code.</p>
<p>Before I get to the code, I want to spend a little time talking about the significance of wp_head() and wp_footer().  These 2 functions are the key to functionality of a lot of plugins and are the real work horses of themes.  The wp_head and wp_footer functions allow WordPress core and plugins to hook into your theme either directly before the <code>&lt;/head&gt;</code> or <code>&lt;/body&gt;</code> html tags in your theme and perform actions.  The majority of the time these actions are used to output style sheets or JavaScript, for use by plugins.  WordPress core uses it to output a lot of good functionality such as relational links to your RSS and ATOM feeds into the head of the document.  <a href="http://josephscott.org/archives/2009/04/wordpress-theme-authors-dont-forget-the-wp_head-function/">Joseph Scott</a> wrote about this nearly a year ago.  His post is fairly short but does a good job at explaining why it is important to include these functions.</p>
<p>Back to the original discussion, which was how do we detect whether or not wp_head and wp_footer are called in the active theme, and if called are they called, was it from the proper locations?</p>
<p>In my proof of concept plugin, we hook into admin_init, which will actually use wp_remote_get() to retrieve the frontend of our WordPress site.  It calls the url with 2 query vars, that if present will cause the plugin to hook into wp_head and wp_footer and output some content that we will later look for.  If the response was successful, as in returning a 200 response code, we will look at the content to see if <code>&lt;!--wp_head--&gt;</code> and <code>&lt;!--wp_footer--&gt;</code> are present.  If they are not we will see an admin notice telling us which problems were found.  If those strings were found but they were not found directly before <code>&lt;/head&gt;</code> or <code>&lt;/body&gt;</code> the notice will alert you of such.</p>
<p>Without further adieu:</p>
<p><script type='text/javascript' src='http://paste.sivel.net/embed/24.js'></script></p>
<p>Just in case you cannot see the code above, use this link: <a href="http://paste.sivel.net/24">http://paste.sivel.net/24</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sivel.net/2010/04/detect-wp_head-and-wp_footer-from-a-plugin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Shadowbox and Lightview Plugins Question</title>
		<link>http://sivel.net/2008/08/shadowbox-lightview-question/</link>
		<comments>http://sivel.net/2008/08/shadowbox-lightview-question/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 00:53:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Questions]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sivel.net/?p=182</guid>
		<description><![CDATA[I have a question for all of the users out there who are using the Shadowbox JS and Lightview JS WordPress plugins. Would you prefer the plugin to automatically add the activator attributes to the links for Shadowbox and Lightview &#8230; <a href="http://sivel.net/2008/08/shadowbox-lightview-question/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have a question for all of the users out there who are using the Shadowbox JS and Lightview JS WordPress plugins.</p>
<p>Would you prefer the plugin to automatically add the activator attributes to the links for Shadowbox and Lightview respectively, rather than having to manually add it to your links?</p>
<p>I am one of those people who believe that more flexibility is a better feature than ease of use by less typing.</p>
<p>With that being said I could see a situation where one would simply want to use Shadowbox or Lightview for all of their image links and where adding the activator attributes to the links would become tiresome.</p>
<p>Perhaps a good compromise would be to add functionality to either enable or disable global activation on image links?  Perhaps making global activation the default would be beneficial?</p>
<p>I think I have already talked myself into adding this functionality but I would still like to hear some user feedback, so tell me what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://sivel.net/2008/08/shadowbox-lightview-question/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
