<?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>WP Engineer &#187; template_tag</title>
	<atom:link href="http://wpengineer.com/tag/template_tag/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Sun, 22 Jan 2012 13:32:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Comment Form Hooks Visualized</title>
		<link>http://wpengineer.com/2205/comment-form-hooks-visualized/</link>
		<comments>http://wpengineer.com/2205/comment-form-hooks-visualized/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 09:59:55 +0000</pubDate>
		<dc:creator>Latz</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[comment form]]></category>
		<category><![CDATA[comment hooks]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2205</guid>
		<description><![CDATA[Most themes (e.g. TwentyTen) use the comment_form() function to insert the comment form after posts. There are quite some hooks inside the function but they are hard to localize. The codex documentation isn't too helpful, neither. To give you an easy overview the following diagrams visualize the points where the various hooks are anchored. The [...]]]></description>
			<content:encoded><![CDATA[<p>Most themes (e.g. TwentyTen) use the <code>comment_form()</code> function to insert the comment form after posts. There are quite some hooks inside the function but they are hard to localize. The <a href="https://codex.wordpress.org/Plugin_API/Action_Reference#Comment.2C_Ping.2C_and_Trackback_Actions">codex documentation</a> isn't too helpful, neither.<br />
To give you an easy overview the following diagrams visualize the points where the various hooks are anchored. The number of available hooks depend on the <a href="https://codex.wordpress.org/Settings_Discussion_SubPanel">discussion settings</a> and the <a href="https://codex.wordpress.org/Roles_and_Capabilities">user's capabilities</a>.</p>
<p>In the most common scenario the user is not logged in, is allowed to comment on the article and the comments are not closed:</p>
<p><img src="http://wpengineer.com/wp-content/uploads/default-wpe.png" alt="" title="default-wpe" width="560" height="453" class="aligncenter size-full wp-image-2208" /></p>
<p>There are six hooks available:</p>
<ul>
<li>comment_form_before</li>
<li>comment_form_top</li>
<li>comment_form_before_fields</li>
<li>comment_form_after_fields</li>
<li>comment_form</li>
<li>comment_form_after</li>
</ul>
<p>You might have noticed that the hooks <code>comment_form</code> and <code>comment_form_after</code> seem to be anchored almost at the same point but depending on the user's role and discussion settings they are not always available so you should take care which hook you are using in your code.</p>
<p><br/><strong><u>User logged in</u></strong><br />
If you are logged in you have fewer hooks available since the name, email and URL input fields are not needed. The missing hooks are</p>
<ul>
<li>form_comment_before_fields</li>
<li>form_comment_after fields</li>
</ul>
<p><img src="http://wpengineer.com/wp-content/uploads/logged_in_wpe.png" alt="" title="logged_in_wpe" width="560" height="296" class="aligncenter size-full wp-image-2209" /></p>
<p><br/><u><strong>User is not logged and "Users must be registered and logged in to comment" activated</strong></u><br />
If your blog is configured that only registered users can comment, an unregistered user will see this comment form and additionally the hook <code>comment_form_must_log_in_after</code> is available. Please notice that in this case the hook <code>comment_form</code> is left out.<br />
<img src="http://wpengineer.com/wp-content/uploads/must_log_in-wpe.png" alt="" title="must_log_in-wpe" width="560" height="136" class="aligncenter size-full wp-image-2212" /></p>
<p><br/>
<p><strong><u>Comments closed</u></strong><br />
If the comments on the post are closed you have only one hook left (<code>comment_form_closed</code>) since the form is not displayed at all:</p>
<p><img src="http://wpengineer.com/wp-content/uploads/comments_closed-wpe.png" alt="" title="comments_closed-wpe" width="560" height="59" class="aligncenter size-full wp-image-2213" /></p>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2205/comment-form-hooks-visualized/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Post Formats – More Creative Ways For A Theme</title>
		<link>http://wpengineer.com/2082/post-formats-more-creative-ways-for-a-theme/</link>
		<comments>http://wpengineer.com/2082/post-formats-more-creative-ways-for-a-theme/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 05:28:08 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[Advent Calendar]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp3.1]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2082</guid>
		<description><![CDATA[First day of our Advent Calendar we show tiny code snippets and brief informations for the Post Formats from WordPress version 3.1. Some theme authors wanted more defined formats - they wanted the feature "post formats". This new functionality will be available in WordPress 3.1 and displays an additional meta-information. The Codex for this functionality [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-01-300x200.jpg" alt="" title="WordPress-Christmas-2010-01" width="300" height="200" class="alignleft size-medium wp-image-2086" /><br />
First day of our Advent Calendar we show tiny code snippets and brief informations for the Post Formats from WordPress version 3.1.</p>
<p>Some theme authors wanted more defined formats - they wanted the feature "post formats". This new functionality will be available in WordPress 3.1 and displays an additional meta-information. The <a href="http://codex.wordpress.org/Post_Formats">Codex</a> for this functionality is available already, and now it's up to the theme authors to use this new feature.<br />
<span id="more-2082"></span><br />
To use this function, you have to activate it with the Theme. This is controlled, similar to other theme features since version 3.0, over a function. The following syntax gives some of the possible post formats and these can then be used directly on the article, as the following screenshot shows.</p>
<pre>
add_theme_support( &#039;post-formats&#039;, array( &#039;aside&#039;, &#039;audio&#039;, &#039;image&#039;, &#039;video&#039; ) );
</pre>
<p>Just put the code into your <em>functions.php</em> of your Themes.</p>
<p><a href="http://wpengineer.com/wp-content/uploads/wp31-postformats.png"><img src="http://wpengineer.com/wp-content/uploads/wp31-postformats-300x181.png" alt="" title="wp31-postformats" width="300" height="181" class="alignnone size-medium wp-image-2083" /></a></p>
<p>As possible keys are the following values available.</p>
<ul>
<li>default</li>
<li>aside</li>
<li>chat</li>
<li>gallery</li>
<li>link</li>
<li>image</li>
<li>quote</li>
<li>status</li>
<li>video</li>
<li>audio</li>
</ul>
<p>Like in <a href="http://www.tumblr.com/">thumblr</a> you can design the according article. Via the defined values you can use this across themes. The format will be output with the function <em>body_class()</em> for instant, which creates a class, which you can access via CSS. An exmaple for the value <em>Aside</em> of the post format.</p>
<pre>
&lt;body class=&quot;single single-post postid-52 single-format-aside&quot;&gt;
</pre>
<p>Alternatively there are conditional tags and functions to get to the assigned type:</p>
<pre>
 echo get_post_format();
</pre>
<p>As so often depends the creativity and usage on the developer. The biggest benefit is probably that defined values exist and as a theme author you can respond to these formats and as a developer you don't have to create a new meta box.</p>
<p><strong>Update</strong>: The UI received an update, see <a href="http://wpengineer.com/2082/post-formats-more-creative-ways-for-a-theme/#comment-5309">Andrew's comment</a>:</p>
<p><img src="http://wpengineer.com/wp-content/uploads/post-formats.jpg" alt="WordPress Post formats" title="WordPress Post formats" width="294" height="327" class="alignnone size-full wp-image-2119" /><br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2082/post-formats-more-creative-ways-for-a-theme/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Use The Comments Of WordPress For More</title>
		<link>http://wpengineer.com/2055/use-the-comments-of-wordpress-for-more/</link>
		<comments>http://wpengineer.com/2055/use-the-comments-of-wordpress-for-more/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 10:30:52 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2055</guid>
		<description><![CDATA[You might want to have comments displayed on different spots. For example, displaying the last x comments in a central template. This requires the latest comments or all comments on your site. This is a small solution that scans all the comments, or a certain number, and is supplied with markup. The following code for [...]]]></description>
			<content:encoded><![CDATA[<p>You might want to have comments displayed on different spots. For example, displaying the last x comments in a central template. This requires the latest comments or all comments on your site. This is a small solution that scans all the comments, or a certain number, and is supplied with markup.<br />
<span id="more-2055"></span><br />
The following code for example belongs in a template, which then serves a page in WordPress and displays the comments. Here are various possibilities and the code should be used only as a theoretical support and facilitate the SQL syntax.<br />
The following solution displays the comments without track-and pingbacks.</p>
<pre>
global $wpdb;

$max = &#039;-1&#039;; // -1 for all
$result = &#039;&#039;;
$sql  = &quot;SELECT c.*, p.post_title FROM $wpdb-&gt;comments c INNER JOIN $wpdb-&gt;posts p ON (c.comment_post_id = p.ID) &quot;;
$sql .= &quot;WHERE comment_approved = &#039;1&#039; &quot;;
$sql .= &quot;AND comment_type not in (&#039;trackback&#039;, &#039;pingback&#039;) &quot;;
$sql .= &quot;AND p.post_status != &#039;trash&#039; &quot;;
$sql .= &quot;ORDER BY comment_date DESC&quot;;
if (&#039;-1&#039; != $max)
	$sql .= &quot; LIMIT 0, $max&quot;;
$results = $wpdb-&gt;get_results($sql);

$templates = &quot;\t&quot; . &#039;&lt;li&gt;%gravatar% &lt;a href=&quot;%authorurl%&quot;&gt;%authorname%&lt;/a&gt; zu &lt;a href=&quot;%posturl%#comment-%commentid%&quot;&gt;%posttitle%&lt;/a&gt; %commentcontent%&lt;/li&gt;&#039; . &quot;\n&quot;;

foreach ($results as $row) {
	$tags = array(
		&#039;%commentdate%&#039;, &#039;%gravatar%&#039;, &#039;%posttitle%&#039;,
		&#039;%posturl%&#039;, &#039;%authorurl%&#039;, &#039;%authorname%&#039;,
		&#039;%commentid%&#039;, &#039;%commentcontent%&#039;
	);
	$replacements = array(
		$row-&gt;comment_date, get_avatar($row-&gt;comment_author_email, &#039;30&#039;), $row-&gt;post_title,
		get_permalink($row-&gt;comment_post_ID), $row-&gt;comment_author_url, $row-&gt;comment_author,
		$row-&gt;comment_ID, $row-&gt;comment_content
	);
	$result .= str_replace($tags, $replacements, $templates);
}
if ($result)
	$result = &#039;&lt;ul&gt;&#039; . &quot;\n&quot; . $result . &#039;&lt;/ul&gt;&#039; . &quot;\n&quot;;

// output
echo $result;
</pre>
<p>If you like to use it <a href="http://wpengineer.com/1038/embed-wordpress-functions-outside-wordpress/">outside of WordPress</a>, then you can use the comment feed as an alternative. Or you include <code>wp-load.php</code> of the installation and you have full control of all functions of WordPress.</p>
<pre>
require(&#039;wp-load.php&#039;);
</pre>
<p>Have fun using it and we appreciate every suggestion, tips and error report in our comment area.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2055/use-the-comments-of-wordpress-for-more/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Individual Design for any Page</title>
		<link>http://wpengineer.com/2043/individual-design-for-any-page/</link>
		<comments>http://wpengineer.com/2043/individual-design-for-any-page/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 13:55:52 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2043</guid>
		<description><![CDATA[The blog has a Theme and for every page an extra style sheet. This current trend of individuality for each content is very common today. Even with WordPress, you can do so; there are several possibilities. One possibility is to create, based on the title, the individual stylesheet. By default, the class assignment of function [...]]]></description>
			<content:encoded><![CDATA[<p>The blog has a Theme and for every page an extra style sheet. This current trend of individuality for each content is very common today. Even with WordPress, you can do so; there are several possibilities. One possibility is to create, based on the title, the individual stylesheet.<br />
By default, the class assignment of function <a href="http://codex.wordpress.org/Template_Tags/body_class" title="more informations in the Codex of WordPress"><code>body_class()</code></a> has already a lot of possibilities. More individuality can be reached with the title or ID.<br />
It is certainly not worth for a traditional blog environment but for a site with little content it works pretty well. As I have implemented in this case.<br />
<span id="more-2043"></span><br />
If a page is loaded, then you can pass the title. If you use this one in the body tag as ID or class and then create for each <code>ID</code> or <code>class</code> a style, the right design will be loaded.</p>
<p>Alternatively, you can work with the ID of the page or article, function the_ID() passes it. Please note, IDs and classes may not start with a number and therefore you must add a string before, for example:</p>
<pre lang="php">
&lt;div id=&quot;page-&lt;?php the_ID(); ?&gt;&quot;&gt;
</pre>
<p>As a final alternative, I would like to mention that you can expand the function <code>body_class()</code> via Hook with own classes. So you can have the title of a page/post via hook in this function.</p>
<pre lang="php">
function fb_title_body_class($classes) {
	global $post;

	$classes&#091;&#093; = sanitize_title_with_dashes( get_the_title( $post-&gt;ID ) );

	return $classes;
}
add_filter( &#039;body_class&#039;, &#039;fb_title_body_class&#039; );
</pre>
<p>In the following I'm showing you the simplest case via title, so that you output only this class and and <code>body_class()</code> is not used.</p>
<h4>With the help of the Title</h4>
<p>Put the stylesheet in the header of your Theme:</p>
<pre lang="php">
&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?php bloginfo(&#039;template_url&#039;); ?&gt;/custom.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
</pre>
<p>Alternatively, this is integrated via Hook <code>wp_head</code> if the specific page is loaded, so you load the explicit style sheet only if it is needed. Everything happens in the <code> functions.php</code> of your Theme.</p>
<p>in your body tag of <code>page.php</code> is the title of the page:</p>
<pre lang="php">
&lt;body class=&quot;&lt;?php echo sanitize_title_with_dashes( get_the_title() ); ?&gt;&quot;&gt;
</pre>
<p>Therefore the page "My Home" has the body tag:</p>
<pre lang="php">
&lt;body class=&quot;my-home&quot;&gt;
and so on...
</pre>
<p>in your <code>custom.css</code> you define all style for class home: for example</p>
<pre lang="css">
.my-home a { color: #090; text-decoration: none; }
.my-home a:visited { color: #999; text-decoration: none; }
.my-home a:hover { color: #f60; text-decoration: none; }
</pre>
<p>in the original Theme it looks like this:</p>
<pre lang="css">
a { color: #009; text-decoration: underline; }
a:visited { color: #999; text-decoration: underline; }
a:hover { color: #c00; text-decoration: underline; }
</pre>
<p>I think it's an approach with a lot potential and so I leave it to your creativity. So if you would like to have for each page a different style sheet, this is an easy solution.</p>
<p>Alternativ a small plugin to add the title of the post to the template tag <code>body_class()</code> as example.</p>
<pre lang="php">
&lt;?php
/**
 * Plugin Name: Title 2 body_class
 * Plugin URI: http://bueltge.de/wordpress-theme-in-abhaengigkeit-des-titel/397/
 * Text Domain: title2bodyclass
 * Domain Path: /languages
 * Description: Add the title of the post to the boy_class-function
 * Author: Frank B&uuml;ltge
 * Version: 0.1
 * Author URI: http://bueltge.de/
 * Donate URI: http://bueltge.de/wunschliste/
 * License: GPL
 * Last change: 26.07.2010 10:37:23
 */ 

/**
License:
==============================================================================
Copyright 2010 Frank Bueltge  (email : frank@bueltge.de)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Requirements:
==============================================================================
This plugin requires WordPress &gt;= 2.8 and tested with PHP Interpreter &gt;= 5.2.9
*/

if ( !class_exists(&#039;title2body_class&#039;) ) {

    global $wp_version;
    if ( !function_exists (&#039;add_action&#039;) || version_compare($wp_version, &quot;2.8alpha&quot;, &quot;&lt;&quot;) ) {
        if (function_exists (&#039;add_action&#039;))
            $exit_msg = &#039;The plugin requires WordPress 2.8 or newer. &lt;a href=&quot;http://codex.wordpress.org/Upgrading_WordPress&quot;&gt;Please update WordPress&lt;/a&gt; or delete the plugin.&#039;;
        else
            $exit_msg = &#039;&#039;;
        header(&#039;Status: 403 Forbidden&#039;);
        header(&#039;HTTP/1.1 403 Forbidden&#039;);
        exit($exit_msg);
    }

    class title2body_class{

        define( &#039;FB_T2BC_BASEDIR&#039;, dirname( plugin_basename(__FILE__) ) );
        define( &#039;FB_T2BC_TEXTDOMAIN&#039;, &#039;title2bodyclass&#039; );

        function __construct() {

            add_action( &#039;body_class&#039;, array( &amp;$this, &#039;title_body_class&#039; ) );
        }

        function title_body_class($classes) {
            global $post;

            $classes&#091;&#093; = sanitize_title_with_dashes( get_the_title( $post-&gt;ID ) );

            return $classes;
        }

        }
    }

    function title2body_class_start(){
        new title2body_class();
    }

    add_action(&#039;plugins_loaded&#039;, &#039;title2body_class_start&#039;);
}
?&gt;
</pre>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2043/individual-design-for-any-page/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New feature in WordPress 2.9 &#8211; the_post_image()</title>
		<link>http://wpengineer.com/1750/new-feature-in-wordpress-2-9-the_post_image/</link>
		<comments>http://wpengineer.com/1750/new-feature-in-wordpress-2-9-the_post_image/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 23:08:42 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp2.9]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1750</guid>
		<description><![CDATA[In WordPress 2.9, there will be the ability to add an image to a post, as it's been known of magazine themes. The image need not be insert into the post. With the new feature the_post_image() you can use the new feature and thus control where to display. The two screenshots show the new post [...]]]></description>
			<content:encoded><![CDATA[<p>In WordPress 2.9, there will be the ability to add an image to a post, as it's been known of magazine themes. The image need not be insert into the post. With the new feature <strong>the_post_image()</strong> you can use the new feature and thus control where to display.<br />
<span id="more-1750"></span></p>
<p>The two screenshots show the new post thumbnail dialog when creating a new article. Here you set the picture.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/post-thumbnail-small.jpg" alt="New Dialog Post Thumbnail" title="New Dialog Post Thumbnail" width="290" height="72" class="aligncenter size-full wp-image-1752" /></p>
<p><img src="http://wpengineer.com/wp-content/uploads/post-thumbnail.jpg" alt="Post Thumbnail Dialog" title="Post Thumbnail Dialog" width="300" height="200" class="aligncenter size-full wp-image-1751" /></p>
<p>In the template you can use the function <strong>the_post_image()</strong> to place the image. Here's an example:</p>
<pre lang="php">
&lt;div class=&quot;entry&quot;&gt;
    &lt;?php the_post_image(); ?&gt;
    &lt;?php the_content(&#039;Read the rest of this entry &raquo;&#039;); ?&gt;
&lt;/div&gt;
</pre>
<p>You can also determine what resolution you want to display.</p>
<pre lang="php">
the_post_image(); // without parameter -&gt; Thumbnail
the_post_image(&#039;thumbnail&#039;); // Thumbnail
the_post_image(&#039;medium&#039;); // Medium resolution
</pre>
<p>Unfortunately, the developers haven't implemented a way to align the image with the classes <code>alignleft, alignright and aligncenter</code>. And this is how it looks like with the default theme of WordPress:</p>
<p><img src="http://wpengineer.com/wp-content/uploads/post-thumbnail-example.jpg" alt="Example of the new function the_post_image" title="Example of the new function the_post_image" width="486" height="253" class="aligncenter size-full wp-image-1753" /><br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1750/new-feature-in-wordpress-2-9-the_post_image/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>WordPress Category Exists?</title>
		<link>http://wpengineer.com/992/wordpress-category-exists/</link>
		<comments>http://wpengineer.com/992/wordpress-category-exists/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 20:17:45 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[template tag]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=992</guid>
		<description><![CDATA[Already tried in WordPress to check if a category exists? There is no Template Tag so you need to create your own solution. I have 3 different solutions prepared, although one solution only works within the framework of the admin area. The individual solutions are not explained in depth but surely understandable if you read [...]]]></description>
			<content:encoded><![CDATA[<p>Already tried in WordPress to check if a category exists? There is no Template Tag so you need to create your own solution.<br />
I have 3 different solutions prepared, although one solution only works within the framework of the admin area.<span id="more-992"></span></p>
<p>The individual solutions are not explained in depth but surely understandable if you read the code. Alternatively, you can also create a custom function and then use it, like a separate Template Tag for the theme. Therefore put this function in the <code>functions.php</code> of the theme.</p>
<p>In order to understand the code, I have as an example either the category called &#8222;<em>Uncategorized</em>&#8220; , or the ID <em>1</em>. These values must of course be adjusted to your theme.</p>
<pre lang="php">
&lt;?php
/**
 * only in admin area
 *
 * @param string $cat_name
 */
if ( is_admin() &amp;&amp; category_exists(&#039;uncategorized&#039;) ) // cat_slug, cat_name
	return true;

/**
 * outside admin area
 *
 * is_term($term, $taxonomy = &#039;&#039;)
 * @param int|string $term The term to check
 * @param string $taxonomy The taxonomy name to use
 */
if ( is_term( &#039;uncategorized&#039; , &#039;category&#039; ) ) // cat_slug, cat_name
	return true;
else
	return false;

/**
 * outside admin area
 *
 * get_category( $category, $output = OBJECT, $filter = &#039;raw&#039; )
 * @param int|object $category Category ID or Category row object
 * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied.

 */
$cat = get_category(1); // cat_ID
if ( !empty( $cat ) )
	return true;
?&gt;
</pre>
<p><!--more--><br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/992/wordpress-category-exists/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>wp_page_menu in WordPress 2.7</title>
		<link>http://wpengineer.com/50/wp_page_menu-in-wordpress-27/</link>
		<comments>http://wpengineer.com/50/wp_page_menu-in-wordpress-27/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 17:56:01 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=50</guid>
		<description><![CDATA[New in WordPress 2.7 is the template tag wp_page_menu(). This function creates a page navigation. As parameter you can add a menu "Home" with show_home , or whatever you like. wp_page_menu(&#039;show_home=Home&#039;); wp_page_menu() is a wrap for wp_list_pages(), which additionally add a link to the homepage and assign the class current_page_item, if the starting page is [...]]]></description>
			<content:encoded><![CDATA[<p>New in WordPress 2.7 is the template tag <code>wp_page_menu()</code>. This function creates a page navigation. As parameter you can add a menu "Home" with <strong>show_home</strong> , or whatever you like.<br />
<span id="more-50"></span></p>
<pre lang="php">
wp_page_menu(&#039;show_home=Home&#039;);
</pre>
<p><code>wp_page_menu()</code> is a wrap for <code>wp_list_pages()</code>, which additionally add a link to the homepage and assign the class <code>current_page_item</code>, if the starting page is active. For users who doesn't know a lot about PHP, this will be a great help.</p>
<p>From the aspect of a theme developer, it might be a problem using CSS Frameworks, which uses their own classes and structure.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/50/wp_page_menu-in-wordpress-27/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>wp_list_comments In WordPress 2.7</title>
		<link>http://wpengineer.com/46/wp_list_comments-in-wordpress-27/</link>
		<comments>http://wpengineer.com/46/wp_list_comments-in-wordpress-27/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 17:54:10 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[template_tag]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=46</guid>
		<description><![CDATA[The comment functionality enhances quite a bit in WordPress 2.7. Additional to the possiblility to answer comments directly in your backend, there is also a threaded comment support available. Threaded comments enables users to reply on an exist comment, and the discussion will be displayed threaded or nested. Below you can see a screenshot from [...]]]></description>
			<content:encoded><![CDATA[<p>The comment functionality enhances quite a bit in WordPress 2.7. Additional to the possiblility to answer comments directly in your backend, there is also a threaded comment support available. Threaded comments enables users to reply on an exist comment, and the discussion will be displayed threaded or nested. Below you can see a screenshot from the default theme:<br />
<span id="more-46"></span><br />
<img src="http://wpengineer.com/wp-content/uploads/wp_list_comments.jpg" alt="Screenshot threded comments in WordPress 2.7" width="320" height="259" class="size-full wp-image-47" /></p>
<p>If you take a look into <code>comments.php</code>, you will notice some alterations. A short "comment loop" was introduced <code>wp_list_comments()</code> and it manages the complete output of comments. Here is the code:</p>
<pre lang="php">
&lt;?php if ( have_comments() ) : ?&gt;
&lt;ol class=&quot;commentlist&quot;&gt;
&lt;?php wp_list_comments($comments); ?&gt;
&lt;/ol&gt;
&lt;?php else: ?&gt;
// some other code
&lt;?php endif; ?&gt;
</pre>
<p>This purge the <code>comments.php</code> immense. But it might be a disadvantage for theme authors, since they hardly have the possibility to change the output of comments. And that WordPress developers having their own vision of HTML and CSS is a common knowledge. Right now, we have to wait and see, since it's an early version. It will be interesting how this develops.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/46/wp_list_comments-in-wordpress-27/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

