<?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>Work, Web, Play &#187; php</title>
	<atom:link href="http://workwebplay.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://workwebplay.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 16 Aug 2010 02:58:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Edit sidebar content as a page in WordPress</title>
		<link>http://workwebplay.com/2008/08/11/wordpress-sidebar-page/</link>
		<comments>http://workwebplay.com/2008/08/11/wordpress-sidebar-page/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 08:16:27 +0000</pubDate>
		<dc:creator>Colin Temple</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://workwebplay.com/?p=25</guid>
		<description><![CDATA[I recently came across a situation where I needed to display the contents of a page in a WordPress sidebar.  Essentially, my client needed an easy way to edit a sidebar that appeared on multiple pages.  Editing a Text widget wasn&#8217;t an option: they needed the flexibility of editing a page. It took a few [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across a situation where I needed to display the contents of a page in a WordPress sidebar.  Essentially, my client needed an easy way to edit a sidebar that appeared on multiple pages.  Editing a Text widget wasn&#8217;t an option: they needed the flexibility of editing a page.<span id="more-25"></span></p>
<p>It took a few tries/revisions to find the best way to do this, so I thought I&#8217;d share my solution.  All I did was create a page with a specific slug (&#8220;sidebarpage&#8221;) and echo its content.  I used it in a sidebar widget, but you could use this anywhere in your WordPress Theme if you&#8217;d like to have an additional editable area.</p>
<div style="background: #fff; border: 2px dotted #eee; padding: 1em; margin-bottom: 1em;"><span style="color: #0000ff;">&lt;?php</span><br />
$sidebarpage = <span style="color: #0000ff;">new WP_Query</span><span style="color: #ff0000;">(</span><span style="color: #008000;">&#8220;pagename=sidebarpage&#8221;</span><span style="color: #ff0000;">)</span>;<br />
<span style="color: #008000;">while<span style="color: #ff0000;">(</span></span>$sidebarpage-&gt;<span style="color: #0000ff;">have_posts</span><span style="color: #ff0000;">())</span> : $sidebarpage-&gt;<span style="color: #0000ff;">the_post</span><span style="color: #ff0000;">()</span>;<br />
<span style="color: #0000ff;">the_content</span><span style="color: #ff0000;">()</span>;<br />
<span style="color: #008000;">endwhile</span>;<br />
<span style="color: #0000ff;">?&gt;</span></div>
<p>Be sure that you&#8217;re creating a seperate WP_Query object (<em>$sidebarpage </em>in this example) &#8212; otherwise you&#8217;ll modify the query on the page itself, and your sidebar content will show up in the main body of your posts/pages as well!</p>
<p>The down-side of having this content stored in a page is that the page will appear in page listings, so be sure to exclude it if these are used in your theme.</p>
]]></content:encoded>
			<wfw:commentRss>http://workwebplay.com/2008/08/11/wordpress-sidebar-page/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
