<?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>Dev Corner &#187; Wordpress Theme Design Tips</title>
	<atom:link href="http://devcorner.georgievi.net/category/wordpress/wp-theme-design/feed" rel="self" type="application/rss+xml" />
	<link>http://devcorner.georgievi.net</link>
	<description>Software Developer's Notepad</description>
	<lastBuildDate>Fri, 12 Aug 2011 20:03:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WordPress Tutorial: Create Shortcode</title>
		<link>http://devcorner.georgievi.net/pages/wordpress/wp-theme-design/wordpress-shortcode-tutorial</link>
		<comments>http://devcorner.georgievi.net/pages/wordpress/wp-theme-design/wordpress-shortcode-tutorial#comments</comments>
		<pubDate>Thu, 26 Nov 2009 18:32:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress Development]]></category>
		<category><![CDATA[Wordpress Theme Design Tips]]></category>
		<category><![CDATA[wordpress development shortcode]]></category>
		<category><![CDATA[wordpress tutorial development shortcode]]></category>

		<guid isPermaLink="false">http://devcorner.georgievi.net/?p=318</guid>
		<description><![CDATA[Shortcodes are very effective way to include dynamic content into your posting. This tutorial will guide you through the process of creating your own shortcode. Just in few easy steps.
In just few minutes you will create a shortcode that includes the post publication date. When you include [post-date] in your post, WordPress will replace it [...]]]></description>
			<content:encoded><![CDATA[<p>Shortcodes are very effective way to include dynamic content into your posting. This tutorial will guide you through the process of creating your own shortcode. Just in few easy steps.<span id="more-318"></span></p>
<p>In just few minutes you will create a shortcode that includes the post publication date. When you include [post-date] in your post, WordPress will replace it automatically with the post date.</p>
<p><strong>1. Create a new post</strong></p>
<p>Let&#8217;s start with creating a post to play with. Publish the post. Here is the post I created.</p>
<p><img src="http://1.bp.blogspot.com/_OvKDL-vK2kY/Sw6-oHxILtI/AAAAAAAAAG0/1G3O24X5UKs/s320/sample-post.gif" alt="Simple WordPress post with post-date shortcode inserted." /></p>
<p>For this tutorial I am using the default WordPress theme. At the end of the post I have inserted <strong>[post-date]</strong> shortcode.<br />
Because the shortcode is not implemented yet, WordPress displays it literally without replacing it.</p>
<p><strong>2. Create a new plugin.</strong></p>
<p>Plugins are placed under WordPress plugins directory. It is good practice to place each plugin into a separate directory. </p>
<p>Create a new directory named <code>post-date</code> under WordPress plugins directory (<code>wp-content/plugins</code>).</p>
<p>Using a text editor, create a text file named <code>post-date.php</code>. You can use any file name that you like, but for this tutorial we will use the <code>post-date.php</code>.</p>
<p>Now you have an empty text file: <code>wp-content/plugins/post-date/post-date.php</code>. This file will contain the code for the shortcode handler.</p>
<p><strong>3. Define the plugin</strong></p>
<p>To identify plugins WordPress uses comments that conform to special format. Enter the following plugin definition in the <code>post-date.php</code> file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: Post-date short code
Plugin URI: http://devcorner.georgievi.net
Description: This plugin defined a 'post-date' shortcode handler.
Author: Ivan Georgiev
Version: 1.5.1
Author URI: http://devcorner.georgievi.net/
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Now you have a plugin defined. You are able to see it under Plugins list in WordPress administrator.</p>
<p><strong>4. Add shortcode handler code</strong></p>
<p>We will create a PHP function that will be invoked when WordPress needs to replace a post-date shortcode.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: Post-date short code
Plugin URI: http://devcorner.georgievi.net
Description: This plugin defined a 'post-date' shortcode handler.
Author: Ivan Georgiev
Version: 1.5.1
Author URI: http://devcorner.georgievi.net/
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> post_date_handler<span style="color: #009900;">&#40;</span><span style="color: #000088;">$atts</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> mysql2date<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M jS, Y'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post-date'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_date_handler'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The <code>add_shortcode</code> function instructs WordPress to invoke the <code>post_date_handler</code> function when it needs to replace a <code>post-date</code> shortcode.</p>
<p>The <code>post_date_handler</code> function returns the formatted date for the current post.</p>
<p>Now you have everyting ready. If you try to view the post you created at the beginning of this tutorial, you will see no change. Why?</p>
<p>One small thing left. You need to activate the newly created plugin.</p>
<p><strong>5. Activate the plugin</strong></p>
<p>Go to the Plugins section in WordPress administrative section. In the plugin list find the &#8216;Post-date shortcode&#8217; plugin and click the &#8216;Activate&#8217; link to activate it.</p>
<p>Open the post and voila! You see that the shortcode text is replaced by the post date.</p>
<p><img src="http://4.bp.blogspot.com/_OvKDL-vK2kY/Sw7I0WIOTBI/AAAAAAAAAHE/2NduEmH10cA/s400/sample-post_ready.gif" alt="The simple post with shortcode replaced" /></p>
<p>If you want to include &#8216;[post-date]&#8216; as a text, you need to use double brackets. You enter &#8216;[[post-date]]&#8217; to get &#8216;[post-date]&#8216;.</p>
<p>This tutorial covers only WordPress shortcode basics. For more detailed description see <a href="http://codex.wordpress.org/Shortcode_API">WordPress shortcode API</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://devcorner.georgievi.net/pages/wordpress/wp-theme-design/wordpress-shortcode-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find current post tags in WordPress</title>
		<link>http://devcorner.georgievi.net/pages/wordpress/wp-theme-design/how-to-find-current-post-tags-in-wordpress</link>
		<comments>http://devcorner.georgievi.net/pages/wordpress/wp-theme-design/how-to-find-current-post-tags-in-wordpress#comments</comments>
		<pubDate>Tue, 24 Nov 2009 15:55:03 +0000</pubDate>
		<dc:creator>baobab</dc:creator>
				<category><![CDATA[WordPress Development]]></category>
		<category><![CDATA[Wordpress Theme Design Tips]]></category>
		<category><![CDATA[wordpress development post tags]]></category>
		<category><![CDATA[wordpress theme design post tags]]></category>

		<guid isPermaLink="false">http://devcorner.georgievi.net/?p=292</guid>
		<description><![CDATA[This tutorial shows how to retrieve tags associated with WordPress post. You can retrieve tags for the current post or any other post.
Solution
To retrieve a list of tags, you need the post ID:

$tags = get_the_tags&#40;$post_id&#41;;

The result in $tags is an array. For each tag assigned with the post, the $tags array contains an object that [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial shows how to retrieve tags associated with WordPress post. You can retrieve tags for the current post or any other post.<span id="more-292"></span></p>
<h4>Solution</h4>
<p>To retrieve a list of tags, you need the post ID:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$tags</span> <span style="color: #339933;">=</span> get_the_tags<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The result in <code>$tags</code> is an array. For each tag assigned with the post, the $tags array contains an object that describes the tag. The tag object has following properties:</p>
<ul>
<li>term_id</li>
<li>name</li>
<li>slug</li>
<li>term_group</li>
<li>term_taxonomy_id</li>
<li>taxonomy</li>
<li>description</li>
<li>parent</li>
<li>count</li>
<li>object_id</li>
</ul>
<p>To retrieve a list of tags for the current post in WordPress Loop:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$tags</span> <span style="color: #339933;">=</span> get_the_tags<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://devcorner.georgievi.net/pages/wordpress/wp-theme-design/how-to-find-current-post-tags-in-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display Images as WordPress Post Thumbnails</title>
		<link>http://devcorner.georgievi.net/pages/special-categories/drafts/wordpress-post-thumbnailsinclude-post-thumbnails</link>
		<comments>http://devcorner.georgievi.net/pages/special-categories/drafts/wordpress-post-thumbnailsinclude-post-thumbnails#comments</comments>
		<pubDate>Tue, 24 Nov 2009 08:44:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Drafts]]></category>
		<category><![CDATA[Wordpress Theme Design Tips]]></category>
		<category><![CDATA[wordpress theme design post icon]]></category>
		<category><![CDATA[wordpress theme design post thumbnail]]></category>

		<guid isPermaLink="false">http://devcorner.georgievi.net/?p=281</guid>
		<description><![CDATA[You have nice WordPress blog set up and running. You want to make your site more attractive and professional by adding images to post excerpts displayed on your WordPress blog&#8217;s home page. This tutorial shows you how you can easily add post thumbnails to your homepage.
Preparation
You can apply this solution to any WordPress theme. You [...]]]></description>
			<content:encoded><![CDATA[<p>You have nice WordPress blog set up and running. You want to make your site more attractive and professional by adding images to post excerpts displayed on your WordPress blog&#8217;s home page. This tutorial shows you how you can easily add post thumbnails to your homepage.<span id="more-281"></span></p>
<p><strong>Preparation</strong><br />
You can apply this solution to any WordPress theme. You will need your favorite WordPress theme and a text editor. We will use custom post fields to specify post thumbnails. Custom fields allow you to define a key and assign it a value.<br />
<strong>Step-by-step Solution</strong></p>
<ol>
<li>Let&#8217;s first create a post.</li>
<li>From Post Editor panel click the &#8220;Add an image&#8221; button and upload an image. The good size for a thumbnail depends on your theme. On some themes it could be 150&#215;150 pixels. On other themes 220&#215;220 pixels is better. Copy the image URL to the Clipboard.</li>
<li>Scroll down and locate the Custom Fields panel. Click the &#8220;Enter new&#8221; link. In the Name filed enter &#8216;icon&#8217;. In the Value field paste the image URL. Click the &#8220;Add Custom Field&#8221; button.</li>
<li>Publish the post. If you now navigate to your home page, you will not see any change. The custom field is defined, but WordPress doesn&#8217;t know how to use it.</li>
<li>Open the index.php file from your theme&#8217;s directory for editing. Locate the WordPress loop and add the following code:

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
   <span style="color: #000088;">$icon</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span>get_the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'icon'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$icon</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt;img
       src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$icon</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;
       alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;&lt;/a&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://devcorner.georgievi.net/pages/special-categories/drafts/wordpress-post-thumbnailsinclude-post-thumbnails/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

