<?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: Create An In-Post (Theme) Options (Meta) Box in WordPress</title>
	<atom:link href="http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/</link>
	<description>WordPress Tips, Tricks and Hacks</description>
	<lastBuildDate>Wed, 10 Mar 2010 06:10:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-6245</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 01 Feb 2010 22:57:26 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-6245</guid>
		<description>What 
return apply_filters( &#039;hybrid_post_meta_boxes&#039;, $meta_boxes );

do ?

I&#039;m interested why you use apply_filter instead of add_filter ?</description>
		<content:encoded><![CDATA[<p>What<br />
return apply_filters( &#8216;hybrid_post_meta_boxes&#8217;, $meta_boxes );</p>
<p>do ?</p>
<p>I&#8217;m interested why you use apply_filter instead of add_filter ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-6021</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sun, 24 Jan 2010 01:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-6021</guid>
		<description>In creating a Wordpress CMS theme, I wanted the typical blog looking page to be a page template. However with that page template, I wanted the user to be able to select which categories they would like to be feed into that specific blog page. So I created a meta box basically how it was done in this tutorial that listed the blog categories and gave the users checkboxes to check off which categories they wanted to use. 

The only problem was that I was worried my users would be confused if they were creating a page that wasn&#039;t a blog page (like a contact or info page or something) and they saw a box that said &quot;Which categories would you like to include in this blog page?&quot; 

So, I created a meta box with the id &quot;blog-options-meta&quot; and my goal was that when the user is in &quot;Edit Page&quot; page, and they selected my &quot;Blog Page&quot; template under the Attributes &gt; template drop down menu, then my &quot;blog-options-meta&quot; meta box would slide down and appear on the screen.

Here&#039;s a screenshot so everyone knows what the heck I&#039;m talking about:
http://jasonbobich.com/jbobich_framework_blog_options.jpg

When you create a meta box, the id of that metabox is inserted into the HTML div tag when Wordpress prints out that meta box, which made it easy to target it with jQuery.

$(document).ready(function(){
		
	//check if initially selected
	if ($(&#039;#page_template&#039;).val() == &quot;template_blog.php&quot; ) {
			$(&quot;#blog-options-meta&quot;).show();
	}
		
	//Targets WP&#039;s template drop down menu	
	$(&quot;#page_template&quot;).click(function(){
		
		//If they select my blog template, slide the meta box down						   
		if ($(&#039;#page_template&#039;).val() == &quot;template_blog.php&quot; ) {
		
			$(&quot;#blog-options-meta&quot;).slideDown(&quot;normal&quot;); 
		
		// if they select any other option, remove the meta box 
		} else {
			
			$(&quot;#blog-options-meta&quot;).slideUp(&quot;normal&quot;);
		
		}
		
	});
});

*Note that the id &quot;page_template&quot; is what Wordpress gives the drop down menu, that I was targeting. So, realistically, I have no control over that id.

Obviously, for this to work you need to insert your javascript into some JS file and add that to your Wordpress admin head along with jQuery. You would also want to include some CSS that initially set your meta box div to &quot;display:none&quot;. You would use the admin_head function to add the js files and css file to your WP admin section. (Google &quot;Wordpress admin_head&quot; if you&#039;re unfamiliar with how to do that.) In my case it makes the most sense to do it this way because I&#039;m selling a Wordpress theme where I obviously only have control over the theme folder.</description>
		<content:encoded><![CDATA[<p>In creating a Wordpress CMS theme, I wanted the typical blog looking page to be a page template. However with that page template, I wanted the user to be able to select which categories they would like to be feed into that specific blog page. So I created a meta box basically how it was done in this tutorial that listed the blog categories and gave the users checkboxes to check off which categories they wanted to use. </p>
<p>The only problem was that I was worried my users would be confused if they were creating a page that wasn&#8217;t a blog page (like a contact or info page or something) and they saw a box that said &#8220;Which categories would you like to include in this blog page?&#8221; </p>
<p>So, I created a meta box with the id &#8220;blog-options-meta&#8221; and my goal was that when the user is in &#8220;Edit Page&#8221; page, and they selected my &#8220;Blog Page&#8221; template under the Attributes &gt; template drop down menu, then my &#8220;blog-options-meta&#8221; meta box would slide down and appear on the screen.</p>
<p>Here&#8217;s a screenshot so everyone knows what the heck I&#8217;m talking about:<br />
<a href="http://jasonbobich.com/jbobich_framework_blog_options.jpg" rel="nofollow">http://jasonbobich.com/jbobich_framework_blog_options.jpg</a></p>
<p>When you create a meta box, the id of that metabox is inserted into the HTML div tag when Wordpress prints out that meta box, which made it easy to target it with jQuery.</p>
<p>$(document).ready(function(){</p>
<p>	//check if initially selected<br />
	if ($(&#8216;#page_template&#8217;).val() == &#8220;template_blog.php&#8221; ) {<br />
			$(&#8220;#blog-options-meta&#8221;).show();<br />
	}</p>
<p>	//Targets WP&#8217;s template drop down menu<br />
	$(&#8220;#page_template&#8221;).click(function(){</p>
<p>		//If they select my blog template, slide the meta box down<br />
		if ($(&#8216;#page_template&#8217;).val() == &#8220;template_blog.php&#8221; ) {</p>
<p>			$(&#8220;#blog-options-meta&#8221;).slideDown(&#8220;normal&#8221;); </p>
<p>		// if they select any other option, remove the meta box<br />
		} else {</p>
<p>			$(&#8220;#blog-options-meta&#8221;).slideUp(&#8220;normal&#8221;);</p>
<p>		}</p>
<p>	});<br />
});</p>
<p>*Note that the id &#8220;page_template&#8221; is what Wordpress gives the drop down menu, that I was targeting. So, realistically, I have no control over that id.</p>
<p>Obviously, for this to work you need to insert your javascript into some JS file and add that to your Wordpress admin head along with jQuery. You would also want to include some CSS that initially set your meta box div to &#8220;display:none&#8221;. You would use the admin_head function to add the js files and css file to your WP admin section. (Google &#8220;Wordpress admin_head&#8221; if you&#8217;re unfamiliar with how to do that.) In my case it makes the most sense to do it this way because I&#8217;m selling a Wordpress theme where I obviously only have control over the theme folder.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Denning</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-5839</link>
		<dc:creator>Alex Denning</dc:creator>
		<pubDate>Wed, 20 Jan 2010 17:13:46 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-5839</guid>
		<description>Yeah, that&#039;s probably better. Do share!</description>
		<content:encoded><![CDATA[<p>Yeah, that&#8217;s probably better. Do share!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-5778</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 18 Jan 2010 17:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-5778</guid>
		<description>Thanks for the reply! It&#039;s funny you linked to that post. I&#039;ve been following ThemeShaper tutorials in building my little WP framework over the  last couple of months. 

As far as making a meta box show on a Page Write admin page only when a specific page template is selected, I ended up just using javascript. 

I figured any solution with PHP would not allow the user to see the new meta box until they actually saved the page and came back to editing it again (which wouldn&#039;t make sense).</description>
		<content:encoded><![CDATA[<p>Thanks for the reply! It&#8217;s funny you linked to that post. I&#8217;ve been following ThemeShaper tutorials in building my little WP framework over the  last couple of months. </p>
<p>As far as making a meta box show on a Page Write admin page only when a specific page template is selected, I ended up just using javascript. </p>
<p>I figured any solution with PHP would not allow the user to see the new meta box until they actually saved the page and came back to editing it again (which wouldn&#8217;t make sense).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Denning</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-5776</link>
		<dc:creator>Alex Denning</dc:creator>
		<pubDate>Mon, 18 Jan 2010 15:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-5776</guid>
		<description>You might be able to do so with Ian Stewart&#039;s &lt;a href=&quot;http://themeshaper.com/registering-new-sidebars-for-custom-page-templates-the-smart-way/&quot; rel=&quot;nofollow&quot;&gt;conditional sidebar stuff&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>You might be able to do so with Ian Stewart&#8217;s <a href="http://themeshaper.com/registering-new-sidebars-for-custom-page-templates-the-smart-way/" rel="nofollow">conditional sidebar stuff</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-5560</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 11 Jan 2010 00:30:09 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-5560</guid>
		<description>Great post! Very helpful. 

Quick question though...

Is there any way to make the meta box show only when a specific page template is selected?</description>
		<content:encoded><![CDATA[<p>Great post! Very helpful. </p>
<p>Quick question though&#8230;</p>
<p>Is there any way to make the meta box show only when a specific page template is selected?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Denning</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-5187</link>
		<dc:creator>Alex Denning</dc:creator>
		<pubDate>Sun, 03 Jan 2010 14:12:51 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-5187</guid>
		<description>Literally just add in a paragraph with what you want to say: &lt;code&gt;&lt;p&gt;This does so and so.&lt;/p&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Literally just add in a paragraph with what you want to say: <code>&lt;p&gt;This does so and so.&lt;/p&gt;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Bedingfield</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-5115</link>
		<dc:creator>Karl Bedingfield</dc:creator>
		<pubDate>Fri, 01 Jan 2010 11:11:16 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-5115</guid>
		<description>Fantastic tutorial! 

Just one question. I would like to put a brief description under each input field as a reminder to what each input does.

How would I do that?

Thanks,
Karl</description>
		<content:encoded><![CDATA[<p>Fantastic tutorial! </p>
<p>Just one question. I would like to put a brief description under each input field as a reminder to what each input does.</p>
<p>How would I do that?</p>
<p>Thanks,<br />
Karl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yes_Papa@mac.com</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-4625</link>
		<dc:creator>Yes_Papa@mac.com</dc:creator>
		<pubDate>Wed, 16 Dec 2009 21:46:43 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-4625</guid>
		<description>Any ideas how to do this ?

Could give me an example ?

Thx for your help.</description>
		<content:encoded><![CDATA[<p>Any ideas how to do this ?</p>
<p>Could give me an example ?</p>
<p>Thx for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yes_Pap</title>
		<link>http://wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/comment-page-1/#comment-4550</link>
		<dc:creator>Yes_Pap</dc:creator>
		<pubDate>Mon, 14 Dec 2009 22:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://wpshout.com/?p=1020#comment-4550</guid>
		<description>Hello,

Do you know how to use the select option ?

I want to create a select meta boxe with a true/false choice.

Thx for your help.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Do you know how to use the select option ?</p>
<p>I want to create a select meta boxe with a true/false choice.</p>
<p>Thx for your help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
