<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Call a Widget with a Shortcode</title>
	<atom:link href="http://digwp.com/2010/04/call-widget-with-shortcode/feed/" rel="self" type="application/rss+xml" />
	<link>http://digwp.com/2010/04/call-widget-with-shortcode/</link>
	<description>Take your WordPress skills to the next level.</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:22:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kerri Lotus</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-6303</link>
		<dc:creator>Kerri Lotus</dc:creator>
		<pubDate>Thu, 08 Jul 2010 14:18:40 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-6303</guid>
		<description>am i doing something wrong? i tried to insert the code into functions.php and it broke my entire installation</description>
		<content:encoded><![CDATA[<p>am i doing something wrong? i tried to insert the code into functions.php and it broke my entire installation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Schryer</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-5989</link>
		<dc:creator>Chris Schryer</dc:creator>
		<pubDate>Mon, 05 Jul 2010 01:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-5989</guid>
		<description>I might be well out to sea here, but I thought you could only call shortcodes on WordPress.com blogs, not self-hosted ones?  I tried, just in case, and all that happens is I get the shortcode outputted as text.  Any ideas?  Am I missing something obvious?
Thanks
C</description>
		<content:encoded><![CDATA[<p>I might be well out to sea here, but I thought you could only call shortcodes on WordPress.com blogs, not self-hosted ones?  I tried, just in case, and all that happens is I get the shortcode outputted as text.  Any ideas?  Am I missing something obvious?<br />
Thanks<br />
C</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Scholz</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4783</link>
		<dc:creator>Thomas Scholz</dc:creator>
		<pubDate>Wed, 19 May 2010 06:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4783</guid>
		<description>The first occurrence of &lt;code&gt;$class&lt;/code&gt; (in &lt;code&gt;sprintf()&lt;/code&gt;) is undefined. And where do you get the &lt;code&gt;$instance&lt;/code&gt; from?

Why did you give the function &lt;code&gt;widget()&lt;/code&gt; such a generic name?</description>
		<content:encoded><![CDATA[<p>The first occurrence of <code>$class</code> (in <code>sprintf()</code>) is undefined. And where do you get the <code>$instance</code> from?</p>
<p>Why did you give the function <code>widget()</code> such a generic name?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrik Spathon</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4542</link>
		<dc:creator>Patrik Spathon</dc:creator>
		<pubDate>Wed, 05 May 2010 12:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4542</guid>
		<description>Is it something like this you were looking for?

&lt;code&gt;extract(shortcode_atts(array(&lt;/code&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;code&gt;&#039;widget_name&#039; =&gt; FALSE,&lt;/code&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;code&gt;&#039;instance&#039; =&gt; &#039;&#039;&lt;/code&gt;
&lt;code&gt;), $atts));&lt;/code&gt;
&lt;code&gt;$instance = str_ireplace(&quot;&amp;&quot;, &#039;&amp;&#039; ,$instance);&lt;/code&gt;

then you can set the instances for the widget.

Usage

&lt;code&gt;[widget widget_name=&quot;WP_Widget_Pages&quot; instance=&quot;title=Pages&amp;sortby=menu_order&amp;exclude=2,41&quot;]&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Is it something like this you were looking for?</p>
<p><code>extract(shortcode_atts(array(</code><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>'widget_name' =&gt; FALSE,</code><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>'instance' =&gt; ''</code><br />
<code>), $atts));</code><br />
<code>$instance = str_ireplace("&amp;amp;", '&amp;' ,$instance);</code></p>
<p>then you can set the instances for the widget.</p>
<p>Usage</p>
<p><code>[widget widget_name="WP_Widget_Pages" instance="title=Pages&amp;sortby=menu_order&amp;exclude=2,41"]</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Coyier</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4484</link>
		<dc:creator>Chris Coyier</dc:creator>
		<pubDate>Sun, 02 May 2010 18:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4484</guid>
		<description>I wish I had a perfect answer... The data exists so there is SOME way to do it. With this code though we are basically creating a new instance of the widget when it is called, not calling a pre-existing widget as defined in the Widgets area of the admin.</description>
		<content:encoded><![CDATA[<p>I wish I had a perfect answer&#8230; The data exists so there is SOME way to do it. With this code though we are basically creating a new instance of the widget when it is called, not calling a pre-existing widget as defined in the Widgets area of the admin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4482</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Sun, 02 May 2010 11:03:20 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4482</guid>
		<description>This is great, thanks.
I&#039;d like to second Michael&#039;s question.
I don&#039;t understand how to call a particular text widget. Is there any way to specify ID or similar?
many thanks</description>
		<content:encoded><![CDATA[<p>This is great, thanks.<br />
I&#8217;d like to second Michael&#8217;s question.<br />
I don&#8217;t understand how to call a particular text widget. Is there any way to specify ID or similar?<br />
many thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Todd Halfpenny</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4442</link>
		<dc:creator>Todd Halfpenny</dc:creator>
		<pubDate>Fri, 30 Apr 2010 13:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4442</guid>
		<description>This is very handy and something I may need to turn into a plugin so that folk don&#039;t need to dabble with the code.
Might be worth doing a spot of self promotion too (sorry ;-) ) for a plugin I have written that let&#039;s you include a whole widgetised area inline insde wordpress page/post content... if you&#039;re interested check out the &lt;a href=&quot;http://wordpress.org/extend/plugins/widgets-on-pages/&quot; rel=&quot;nofollow&quot;&gt;Widgets on Pages&lt;/a&gt; plugin over at wordpress.org.
I&#039;d be interested in hearing your views on this.</description>
		<content:encoded><![CDATA[<p>This is very handy and something I may need to turn into a plugin so that folk don&#8217;t need to dabble with the code.<br />
Might be worth doing a spot of self promotion too (sorry ;-) ) for a plugin I have written that let&#8217;s you include a whole widgetised area inline insde wordpress page/post content&#8230; if you&#8217;re interested check out the <a href="http://wordpress.org/extend/plugins/widgets-on-pages/" rel="nofollow">Widgets on Pages</a> plugin over at wordpress.org.<br />
I&#8217;d be interested in hearing your views on this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Krapf</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4342</link>
		<dc:creator>Michael Krapf</dc:creator>
		<pubDate>Wed, 21 Apr 2010 03:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4342</guid>
		<description>Is there a way to include an &lt;code&gt;$instance&lt;/code&gt; in the shortcode?

 An example of the full version would be: 

&lt;code&gt;&lt;?php the_widget(&#039;WP_Widget_Text&#039;, $instance, $args); ?&gt;&lt;/code&gt;  

If so, then you could narrow the call using

instance:
    * title
    * text
    * filter

So in addition to calling the widget, I would like to specify which version of the widget.</description>
		<content:encoded><![CDATA[<p>Is there a way to include an <code>$instance</code> in the shortcode?</p>
<p> An example of the full version would be: </p>
<p><code>&lt;?php the_widget('WP_Widget_Text', $instance, $args); ?&gt;</code>  </p>
<p>If so, then you could narrow the call using</p>
<p>instance:<br />
    * title<br />
    * text<br />
    * filter</p>
<p>So in addition to calling the widget, I would like to specify which version of the widget.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Coyier</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4291</link>
		<dc:creator>Chris Coyier</dc:creator>
		<pubDate>Fri, 16 Apr 2010 12:58:38 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4291</guid>
		<description>Check out the function in the code above:

the_widget</description>
		<content:encoded><![CDATA[<p>Check out the function in the code above:</p>
<p>the_widget</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://digwp.com/2010/04/call-widget-with-shortcode/#comment-4288</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 16 Apr 2010 07:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://digwp.com/?p=1752#comment-4288</guid>
		<description>Hey Chris

Can you call this via php at all?

Maybe something like this?

&lt;code&gt;&lt;?php widget(widget_name=Your_Custom_Widget&#039;) ; ?&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hey Chris</p>
<p>Can you call this via php at all?</p>
<p>Maybe something like this?</p>
<p><code>&lt;?php widget(widget_name=Your_Custom_Widget') ; ?>&lt;/code></code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

