<?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: Control your own WordPress custom fields</title>
	<atom:link href="http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/</link>
	<description>Freelance WordPress developer in London - XHTML, CSS &#38; design</description>
	<lastBuildDate>Thu, 04 Mar 2010 17:46:21 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3860</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Wed, 27 Jan 2010 15:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3860</guid>
		<description>I&#039;ve not restricted the code to one category before, but it should be doable with some digging around with the &lt;code&gt;$post&lt;/code&gt; object. The only thing is that of course you wouldn&#039;t be able to display them until a post is created (and the category set).</description>
		<content:encoded><![CDATA[<p>I&#8217;ve not restricted the code to one category before, but it should be doable with some digging around with the <code>$post</code> object. The only thing is that of course you wouldn&#8217;t be able to display them until a post is created (and the category set).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3859</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Wed, 27 Jan 2010 15:37:42 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3859</guid>
		<description>Hey Steve, Sorry to bother you once again!

I&#039;ve created all the fields I want, but now all the fields show on every post-page.php. I&#039;ve tried a whole bunch of combintions using the scope, but can&#039;t seem to get them to work. I tried creating new scopes and just adding page-new.php?cat=3 to the if statement but that doesn&#039;t seem to work....

I would really appreciated it if you could give me an example of how I could make the custom fields appear for only one category. What can or should I be looking for that makes each page unique. In your instructions you talk about showing fields for only certain page templates but I really need it to work by category.

I&#039;ve used a plugin called &quot;Category Write Panels&quot; so in my left hand menu I have a list of all my Categories each with there own &quot;Edit&quot; and &quot;And New&quot; links.

Please help :(

Thanks for your time in advance</description>
		<content:encoded><![CDATA[<p>Hey Steve, Sorry to bother you once again!</p>
<p>I&#8217;ve created all the fields I want, but now all the fields show on every post-page.php. I&#8217;ve tried a whole bunch of combintions using the scope, but can&#8217;t seem to get them to work. I tried creating new scopes and just adding page-new.php?cat=3 to the if statement but that doesn&#8217;t seem to work&#8230;.</p>
<p>I would really appreciated it if you could give me an example of how I could make the custom fields appear for only one category. What can or should I be looking for that makes each page unique. In your instructions you talk about showing fields for only certain page templates but I really need it to work by category.</p>
<p>I&#8217;ve used a plugin called &#8220;Category Write Panels&#8221; so in my left hand menu I have a list of all my Categories each with there own &#8220;Edit&#8221; and &#8220;And New&#8221; links.</p>
<p>Please help :(</p>
<p>Thanks for your time in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miklb</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3835</link>
		<dc:creator>miklb</dc:creator>
		<pubDate>Tue, 26 Jan 2010 00:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3835</guid>
		<description>Steve, thanks for the quick reply. I&#039;m not sure of the ramifications, but I simply commented that line out and haven&#039;t received either error again in testing. I&#039;m also not sure of the ramifications of not using a prefix, and just using the existing custom fields I had, but otherwise, it&#039;s a great example of code, and perfect for what I had originally set out to accomplish. Cheers!</description>
		<content:encoded><![CDATA[<p>Steve, thanks for the quick reply. I&#8217;m not sure of the ramifications, but I simply commented that line out and haven&#8217;t received either error again in testing. I&#8217;m also not sure of the ramifications of not using a prefix, and just using the existing custom fields I had, but otherwise, it&#8217;s a great example of code, and perfect for what I had originally set out to accomplish. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3834</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Tue, 26 Jan 2010 00:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3834</guid>
		<description>miklb, I&#039;ve not seen this error before. Autosaves should be excluded as per the note at the end. I developed this code on 2.8, and actually I&#039;ve not tried it on 2.9 yet (the client wants to stick to 2.8.6 until they have to upgrade due to security). Maybe an issue with 2.9? I&#039;ll post if I run into the same thing when I upgrade---let me know if you solve this.</description>
		<content:encoded><![CDATA[<p>miklb, I&#8217;ve not seen this error before. Autosaves should be excluded as per the note at the end. I developed this code on 2.8, and actually I&#8217;ve not tried it on 2.9 yet (the client wants to stick to 2.8.6 until they have to upgrade due to security). Maybe an issue with 2.9? I&#8217;ll post if I run into the same thing when I upgrade&#8212;let me know if you solve this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miklb</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3831</link>
		<dc:creator>miklb</dc:creator>
		<pubDate>Mon, 25 Jan 2010 22:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3831</guid>
		<description>Very nice tutorial, and just what I was looking for. One problem I&#039;m seeing is that I&#039;m getting a &quot;Undefined index: my-custom-fields_wpnonce&quot; as well as a header already sent warning. Not sure if it&#039;s happening on an autosave or not. The undefined index is happening on the second reference to the wpnonce. Using 2.9.1.1. Any tips appreciated.</description>
		<content:encoded><![CDATA[<p>Very nice tutorial, and just what I was looking for. One problem I&#8217;m seeing is that I&#8217;m getting a &#8220;Undefined index: my-custom-fields_wpnonce&#8221; as well as a header already sent warning. Not sure if it&#8217;s happening on an autosave or not. The undefined index is happening on the second reference to the wpnonce. Using 2.9.1.1. Any tips appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3824</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Mon, 25 Jan 2010 11:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3824</guid>
		<description>Stephen, glad this code helped you out! I don&#039;t know the More Fields plugin, but if it just managed standard custom fields, this code should be able to take those fields over if you add them to the &lt;code&gt;$customFields&lt;/code&gt; array. The standard WP custom fields box is designed to output anything that&#039;s been set for the current post (as long as it&#039;s not hidden using the underscore prefix). The output of the above code is governed by what fields you&#039;ve pre-defined---it really came about as a result of my wanting to control the fields that a client used. So, you have to manually specify which fields are to be managed.

If More Fields stores anything outside the standard WP custom fields system, you&#039;ll have to whip up some kind of PHP export / import script.</description>
		<content:encoded><![CDATA[<p>Stephen, glad this code helped you out! I don&#8217;t know the More Fields plugin, but if it just managed standard custom fields, this code should be able to take those fields over if you add them to the <code>$customFields</code> array. The standard WP custom fields box is designed to output anything that&#8217;s been set for the current post (as long as it&#8217;s not hidden using the underscore prefix). The output of the above code is governed by what fields you&#8217;ve pre-defined&#8212;it really came about as a result of my wanting to control the fields that a client used. So, you have to manually specify which fields are to be managed.</p>
<p>If More Fields stores anything outside the standard WP custom fields system, you&#8217;ll have to whip up some kind of PHP export / import script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Heyes</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3822</link>
		<dc:creator>Stephen Heyes</dc:creator>
		<pubDate>Mon, 25 Jan 2010 01:49:40 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3822</guid>
		<description>I can&#039;t explain how excited I was to find a solution for a big conflict I was getting using the plugins More Fields &amp; Adminimize!!! So thanks very much!

I just pasted the code as you said and Voila!!! It worked!! I now have a second custom fields box :)

Now I will admit I&#039;m new to php but have enough knowledge to get this workign so far :) but if I ask something really dumb I do apologizes.

So my 1st question would be. How can I use your code to pull or update all the custom fields I&#039;ve already setup with the more More Fields plugin? I&#039;ve deactivated it, and I can see all the date in the standard custom fields box used by wordpress, I was hoping that if I created the same fields, named them the same in the array they would show..

My 2nd qustion, if there isn&#039;t a solution to my 1st question, and i  have to go and transfer all the date into the new custom field box added by your code, what code would I use to extract the info I need into my theme template?

Below is an example of the code I was using to get the info when using the More Fields plugin....

&lt;code&gt;
 $value )
    echo $value;
?&gt;&lt;/code&gt;

Hope you can help, thanks for your time in advance!</description>
		<content:encoded><![CDATA[<p>I can&#8217;t explain how excited I was to find a solution for a big conflict I was getting using the plugins More Fields &amp; Adminimize!!! So thanks very much!</p>
<p>I just pasted the code as you said and Voila!!! It worked!! I now have a second custom fields box :)</p>
<p>Now I will admit I&#8217;m new to php but have enough knowledge to get this workign so far :) but if I ask something really dumb I do apologizes.</p>
<p>So my 1st question would be. How can I use your code to pull or update all the custom fields I&#8217;ve already setup with the more More Fields plugin? I&#8217;ve deactivated it, and I can see all the date in the standard custom fields box used by wordpress, I was hoping that if I created the same fields, named them the same in the array they would show..</p>
<p>My 2nd qustion, if there isn&#8217;t a solution to my 1st question, and i  have to go and transfer all the date into the new custom field box added by your code, what code would I use to extract the info I need into my theme template?</p>
<p>Below is an example of the code I was using to get the info when using the More Fields plugin&#8230;.</p>
<p><code><br />
 $value )<br />
    echo $value;<br />
?&gt;</code></p>
<p>Hope you can help, thanks for your time in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Csabbencs</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3820</link>
		<dc:creator>Csabbencs</dc:creator>
		<pubDate>Sun, 24 Jan 2010 21:41:15 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3820</guid>
		<description>My mistake. Thanks, Steve. Now, I just don&#039;t understand myself why I thought of putting it in the core function.php when I totally agree with you that the core should not be touched unless someone wants to go mad when upgrading. :)</description>
		<content:encoded><![CDATA[<p>My mistake. Thanks, Steve. Now, I just don&#8217;t understand myself why I thought of putting it in the core function.php when I totally agree with you that the core should not be touched unless someone wants to go mad when upgrading. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3816</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Sun, 24 Jan 2010 18:49:35 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3816</guid>
		<description>Csabbencs, as stated in the post, this code goes into the &lt;code&gt;functions.php&lt;/code&gt; file of a customized theme. If you&#039;re not happy customizing themes, it&#039;s not for you---check out the plugins mentioned. If you are, put the code into &lt;code&gt;/wp-content/themes/[your-theme]/functions.php&lt;/code&gt;.

I&#039;ve altered the post to emphasize this more, it seems to be a common mistake for people to put theme code into &lt;code&gt;/wp-includes/functions.php&lt;/code&gt;. As a general rule, you should &lt;em&gt;never&lt;/em&gt; alter WP core files like this. All customization should be via themes and plugins. If you need some customization that can&#039;t be done with these, then... well, if you&#039;ve decided that, you probably know what you&#039;re doing and it&#039;s nice that WP&#039;s core is open. But generally---leave WP core code alone :-)</description>
		<content:encoded><![CDATA[<p>Csabbencs, as stated in the post, this code goes into the <code>functions.php</code> file of a customized theme. If you&#8217;re not happy customizing themes, it&#8217;s not for you&#8212;check out the plugins mentioned. If you are, put the code into <code>/wp-content/themes/[your-theme]/functions.php</code>.</p>
<p>I&#8217;ve altered the post to emphasize this more, it seems to be a common mistake for people to put theme code into <code>/wp-includes/functions.php</code>. As a general rule, you should <em>never</em> alter WP core files like this. All customization should be via themes and plugins. If you need some customization that can&#8217;t be done with these, then&#8230; well, if you&#8217;ve decided that, you probably know what you&#8217;re doing and it&#8217;s nice that WP&#8217;s core is open. But generally&#8212;leave WP core code alone :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Csabbencs</title>
		<link>http://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/#comment-3812</link>
		<dc:creator>Csabbencs</dc:creator>
		<pubDate>Sun, 24 Jan 2010 15:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=269#comment-3812</guid>
		<description>Hi, I got this: Fatal error: Call to undefined function add_action() in ... \wp-includes\functions.php ... I have PHP 5.3.0. Could you please help? I copied the &#039;full code&#039; part without any change into functions.php.</description>
		<content:encoded><![CDATA[<p>Hi, I got this: Fatal error: Call to undefined function add_action() in &#8230; \wp-includes\functions.php &#8230; I have PHP 5.3.0. Could you please help? I copied the &#8216;full code&#8217; part without any change into functions.php.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
