<?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>cssOrigins.com &#187; Custom Fields</title>
	<atom:link href="http://www.cssOrigins.com/tag/custom-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cssOrigins.com</link>
	<description>Css Origins, Design Blog and Wordpress Publishing Platform</description>
	<lastBuildDate>Mon, 12 Jul 2010 06:35:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Creating Custom Write Panels in WP</title>
		<link>http://www.cssOrigins.com/2009/creating-custom-write-panels-in-wp/</link>
		<comments>http://www.cssOrigins.com/2009/creating-custom-write-panels-in-wp/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 07:07:33 +0000</pubDate>
		<dc:creator>Hunter Brelsford</dc:creator>
				<category><![CDATA[Archive]]></category>
		<category><![CDATA[News Press]]></category>
		<category><![CDATA[Recently Read]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Custom Fields]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.cssOrigins.com/?p=405</guid>
		<description><![CDATA[Just finished a pretty good article written at wefunction.com, the purpose was to teach the WP community how to creatively add functionality to their website/blog by using custom panels in the add posts/page area. Check the tutorial out. No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Just finished a pretty good article written at wefunction.com, the purpose was to teach the WP community how to creatively add functionality to their website/blog by using custom panels in the add posts/page area.</p>
<p><a href="http://wefunction.com/2008/10/tutorial-creating-custom-write-panels-in-wordpress/">Check the tutorial out.</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cssOrigins.com/2009/creating-custom-write-panels-in-wp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically Retrieve The First Image From Posts On Your Home Page</title>
		<link>http://www.cssOrigins.com/2009/retrieve-first-homepage/</link>
		<comments>http://www.cssOrigins.com/2009/retrieve-first-homepage/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 06:21:56 +0000</pubDate>
		<dc:creator>Hunter Brelsford</dc:creator>
				<category><![CDATA[Archive]]></category>
		<category><![CDATA[News Press]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Custom Fields]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.cssOrigins.com/?p=249</guid>
		<description><![CDATA[I found this particularly interesting, because I use a similar method to list images on the home page of my site as well. over the weekend if time allows I&#8217;ll be reviewing and adjusting my code. Hopefully this method will allow me to more easily display my post pictures where I need them. Thank you [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I found this particularly interesting, because I use a similar method to list images on the home page of my site as well. over the weekend if time allows I&#8217;ll be reviewing and adjusting my code. Hopefully this method will allow me to more easily display my post pictures where I need them. Thank you <a href="http://www.smashingmagazine.com/2009/04/15/10-exceptional-wordpress-hacks/" target="_blank" title="Smashing magazine">Smashing Magazine</a> for posting.<span id="more-249"></span></p>
<p><img src="http://www.cssOrigins.com/wp-content/uploads/2009/04/sm5.jpg" /><br />
Automatically Retrieve The First Image From Posts On Your Home Page</p>
<p><strong>The problem</strong> . Many WordPress users use custom fields to display a thumbnail on their blog home page. Of course, this is a nice solution, but how about automatically retrieving the first image from a post and using it as a thumbnail?</p>
<p><strong>The solution</strong> . This hack is quite easy to implement:</p>
<ol>
<li>Open the functions.php file in your theme.</li>
<li>Paste this code in. Don’t forget to specify a default image on line 10 in case a post of yours does not have an image.function catch_that_image {<br />
global $post, $posts;<br />
$first_img = &#8221;;<br />
ob_start;<br />
ob_end_clean;<br />
$output = preg_match_all&#8217;//i&#8217;, $post-&gt;post_content, $matches;<br />
$first_img = $matches [1] [0];<br />
ifempty$first_img{ //Defines a default image<br />
$first_img = &quot;/images/default.jpg&quot;;<br />
}<br />
return $first_img;</li>
<li>Save the functions.php file.</li>
<li>On your blog home page index.php, call the function this way to get the URL of the first image from the post:</li>
</ol>
<p><span><span>&lt;?php </span> <span class="func">echo</span> <span> catch_that_image() ?&gt;</span> </span></p>
<p><strong>Code explanation</strong> . The function uses the global variable $post to parse the post’s content with a regular expression. If an image is found, its URL is returned by the function. If not, the default image URL is returned.</p>
<p>via <a href="http://www.smashingmagazine.com/2009/04/15/10-exceptional-wordpress-hacks/">10 Exceptional WordPress Hacks | Developer&#8217;s Toolbox | Smashing Magazine</a> .</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cssOrigins.com/2009/retrieve-first-homepage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress unleashed</title>
		<link>http://www.cssOrigins.com/2009/wordpress-unleashed/</link>
		<comments>http://www.cssOrigins.com/2009/wordpress-unleashed/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 03:35:37 +0000</pubDate>
		<dc:creator>Hunter Brelsford</dc:creator>
				<category><![CDATA[Archive]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[Cssm Html]]></category>
		<category><![CDATA[Custom Fields]]></category>
		<category><![CDATA[Dynamic]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.cssOrigins.com/?p=173</guid>
		<description><![CDATA[For those of you out there that are wordpress developers this probably isn&#8217;t new or exciting information. But this is to those of you who just started or have very little php or otherwise programming experience. Note that this article takes at the bare minimal a basic programming understanding (ie what a variable is, and [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>For those of you out there that are wordpress developers this probably isn&#8217;t new or exciting information.<span id="more-173"></span> But this is to those of you who just started or have very little php or otherwise programming experience.</p>
<p>Note that this article takes at the bare minimal a basic programming understanding (ie what a variable is, and that code is logical)</p>
<h3>The if () { }</h3>
<p>if statements are great if your looking to target specific content with your dynamic values, for instance call a sidebar only on the home page.</p>
<blockquote><p>&lt;?php if (is_front_page()) {<br />
get_sidebar();<br />
} ?&gt;</p></blockquote>
<p>or if you would like to target multiple pages, its very similar</p>
<blockquote><p>&lt;?php if (is_page(&#8217;2,3,6,home&#8217;)) {<br />
// do stuff here on those specific pages,<br />
}</p></blockquote>
<p>Outside the loop</p>
<h3>Calling your own posts or categories</h3>
<blockquote><p>&lt;?php<br />
$my_query = new WP_Query(&#8216;category_name=yourcategory&amp;showposts=4&#8242;);<br />
echo &#8216;&lt;ul&gt;&#8217;;<br />
while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();<br />
echo &#8216;&lt;li&gt; stuff goes here &lt;/li&gt;&#8217;;</p>
<p>endwhile;<br />
echo &#8216;&lt;/ul&gt;&#8217;;<br />
?&gt;</p></blockquote>
<h3>Custom Fields</h3>
<blockquote><p>call your custom field right before you need it<br />
$key=&#8221;yourcustomfield&#8221;;<br />
then simply call echo the key like so<br />
echo get_post_meta($post-&gt;ID, $key, true);</p></blockquote>
<p>a custom key can contain pictures, html, code.</p>
<p><strong>HTML in php code</strong></p>
<p>&lt;?php echo &#8216; &lt;div&gt;all this is html&lt;/div&gt; &#8216;; ?&gt;  make sure you end your echo quotes and use your semicolen to indicate the end of a statement. while everything else inside will be printed to the screen</p>
<p>Utilizing just these things can utterly unleash wordpress you will no longer be constrained to what you can put on your sidebar or you can hand craft your home page to pull posts from different sources. The possibilities are endless.</p>
<p>Some examples are as follow</p>
<ol>
<li>dynamically add or remove the sidebar from a page or post</li>
<li>create custom banner images for each unique page</li>
<li>call post titles in your sidebar that relate to the one the user is currently looking at</li>
</ol>
<p>All this and more while keeping your site still around 90% editable in the designers eye and easily manageable in the clients eye.</p>
<p>I would like to mention that since the best and easiest way for editing material in custom places is by calling the categories they are associated with. This in turn can leave you with many categories some of which the client should add and edit and others maybe not so much. But my point is that it&#8217;s important to document those things and provide them to the client at the completion of your contract. It&#8217;s a good practice and it covers your bases, and outlines what can and cannot be changed within their site if you &#8220;sold&#8221; them that ability in the first place.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cssOrigins.com/2009/wordpress-unleashed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

