
<?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>Web Developer Plus &#187; Wordpress</title>
	<atom:link href="http://webdeveloperplus.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdeveloperplus.com</link>
	<description>The Ultimate Web Developer&#039;s Resource</description>
	<lastBuildDate>Sun, 04 Jul 2010 11:38:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>12 Lesser Known But Useful WordPress Hacks</title>
		<link>http://webdeveloperplus.com/wordpress/12-lesser-known-but-useful-wordpress-hacks/</link>
		<comments>http://webdeveloperplus.com/wordpress/12-lesser-known-but-useful-wordpress-hacks/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:01:28 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[Popular]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[code snippets]]></category>
		<category><![CDATA[wordpress hacks]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/?p=584</guid>
		<description><![CDATA[Wordpress is not only a great blogging tool but a great content management platform that provides a lot of ways to let you hack into into its functionality to make it do whatever you want. Here are 12 lesser known wordpress hacks/ tricks that you might find useful for your next WordPress related project.]]></description>
			<content:encoded><![CDATA[<p>WordPress is not only a great blogging tool but a great content management platform that provides a lot of ways to let you hack into into its functionality to make it do whatever you want. Here are 12 lesser known wordpress hacks/ tricks that you might find useful for your next WordPress related project.</p>
<p>Most of these hacks require your WordPress template to have <em>functions.php</em> file, if it doesn&#8217;t exist, create one.</p>
<h4>1. Add private notes to your WordPress blog posts</h4>
<p>If you would like to add reference notes to your posts that will only be visible to authors of your blog, add this function to your theme&#8217;s <em>functions.php</em> file which will create a shortcode <em>[note]</em> so that you can add notes for authors by including them in <em>[note]</em> and <em>[/note]</em> while writing the post.<span id="more-584"></span></p>
<pre name="code" class="php" >
add_shortcode( 'note', 'sc_note' );
function sc_note( $atts, $content = null ) {
	 if ( current_user_can( 'publish_posts' ) )
		return '&lt;div class=&quot;note&quot;&gt;'.$content.'&lt;/div&gt;';
	return '';
}
</pre>
<p><em>Source:</em> <a href="http://www.wprecipes.com/add-private-notes-to-your-wordpress-blog-posts" >Add Private Notes to your WordPress Blog Posts &#8211; WpRecipes</a></p>
<h4>2. How to disable HTML in WordPress comments</h4>
<p>WordPress allows some HTML tags like <code>&lt;a&gt;</code>, <code>&lt;em&gt;</code>, <code>&lt;strong&gt;</code> within comment text. But if you would like to disable this feature on your blog to prevent users from adding any HTML content within comment text, add this function to your theme&#8217;s <em>functions.php</em> file. This will treat the HTML content within comment text as literals and display them as it is.</p>
<pre name="code" class="php" >
// This will occur when the comment is posted
function plc_comment_post( $incoming_comment ) {

	// convert everything in a comment to display literally
	$incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);

	// the one exception is single quotes, which cannot be #039; because WordPress marks it as spam
	$incoming_comment['comment_content'] = str_replace( &quot;'&quot;, '&amp;apos;', $incoming_comment['comment_content'] );

	return( $incoming_comment );
}

// This will occur before a comment is displayed
function plc_comment_display( $comment_to_display ) {

	// Put the single quotes back in
	$comment_to_display = str_replace( '&amp;apos;', &quot;'&quot;, $comment_to_display );

	return $comment_to_display;
}

add_filter( 'preprocess_comment', 'plc_comment_post', '', 1);
add_filter( 'comment_text', 'plc_comment_display', '', 1);
add_filter( 'comment_text_rss', 'plc_comment_display', '', 1);
add_filter( 'comment_excerpt', 'plc_comment_display', '', 1);
</pre>
<p><em>Source:</em> <a href="http://www.theblog.ca/literal-comments" >How to disable HTML in WordPress Comments</a></p>
<h4>3. Check if a WordPress plugin is active</h4>
<p>You might sometime need to check whether a particular plugin is activated or not either to use its functionality or prevent any conflicts from occurring. WordPress provides a function <code>is_plugin_active</code> that accepts path to the plugin file and checks to see if plugin is activated or not.</p>
<pre name="code" class="php" >
&lt;?php
if (is_plugin_active('plugin-directory/plugin-file.php')) {
    //plugin is activated
}
?&gt;
</pre>
<p><em>Source:</em> <a href="http://www.wprecipes.com/check-if-a-wordpress-plugin-is-active-the-easy-way" >Check if a WordPress Plugin is active &#8211; WpRecipes</a></p>
<h4>4. Prevent Plugins from automatically loading stylesheets and scripts</h4>
<p>Many plugins add their own stylesheets and scripts to your site to perform their function. But if you are using a lot of plugins on your WordPress blog, then this might lead to slow loading of your web pages as lots of scripts and stylesheets will require to be loaded first. What you can do to boost performance of your site while using plugins is combine their CSS and JavaScript files and prevent them to load on their own. For that you&#8217;ll need to look into plugin files and find out the handler names of all the CSS and JS files plugins are loading using <code>wp_enqueue_script()</code> and <code>wp_enqueue_style()</code> functions.<br />
For example, if you use wp-pagenavi plugin, it loads its own stylesheet using the function:</p>
<pre name="code" class="php" >
wp_enqueue_style('wp-pagenavi', plugins_url('wp-pagenavi/pagenavi-css.css'), false, '2.50', 'all');
</pre>
<p>The first parameter to <code>wp_enqueue_style()</code> or <code>wp_enqueue_script()</code> is the name of handler for CSS or JS file.<br />
In this case the handler name is <strong>wp-pagenavi</strong>. Now add these lines to your theme&#8217;s <em>functions.php</em> file to prevent it from loading.</p>
<pre name="code" class="php" >
//Prevent Stylesheets from loading
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );

function my_deregister_styles() {
	wp_deregister_style( 'wp-pagenavi' );
}

//Prevent JavaScript files from loading automatically
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );

function my_deregister_javascript() {
	wp_deregister_script( 'nameofhandler );
}
</pre>
<p><em>Source:</em> <a href="http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles" >How to Disable Scripts and Styles &#8211; Justin Tadlock</a></p>
<h4>5. Showing Last Modified Date for a post</h4>
<p>If you regularly update your old blog posts, then why not show the last modified date on the post page to let readers know when the post was last updated. Use this code to display the last modified date if the post has been modified at a later date.</p>
<pre name="code" class="php" >
Posted on &lt;?php the_time('F jS, Y') ?&gt;
&lt;?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time != $u_time) {
echo &quot;and last modified on &quot;;
the_modified_time('F jS, Y');
echo &quot;. &quot;; } ?&gt;
</pre>
<p><em>Source:</em> <a href="http://wphacks.com/how-to-show-last-modified-wordpress-post/" >Showing Last Modified On Your WordPress Posts &#8211; WPHacks</a></p>
<h4>6. Custom Taxonomies in WordPress</h4>
<p>By default, WordPress has two taxonomies categories and tags to group posts but custom taxonomies allow you to group your pages in your own custom ways, for example if you are running a movie review blog, you might want to add a taxonomy of <em>genre</em> to group movie review by genre, or a taxonomy of <em>actors</em> to group posts by actors. Custom taxonomies free you from restrictions of categories and tags.</p>
<p>You can add a custom taxonomy by adding this code to your theme&#8217;s <em>functions.php</em> file.</p>
<pre name="code" class="php" >
add_action( 'init', 'create_my_taxonomies', 0 );

function create_my_taxonomies() {
	register_taxonomy( 'genre', 'post', array( 'hierarchical' =&gt; false, 'label' =&gt; 'Genre', 'query_var' =&gt; true, 'rewrite' =&gt; true ) );
	register_taxonomy( 'actors', 'post', array( 'hierarchical' =&gt; false, 'label' =&gt; 'Actors', 'query_var' =&gt; true, 'rewrite' =&gt; true ) );
}
</pre>
<p>This will add new boxes to your add post page in admin panel if you are using WordPress 2.8+ using which you can add values for custom taxonomies. Justin Tadlock has written complete tutorial on <a href="http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28">how to create and use custom taxonomies</a>, refer to it for more.</p>
<h4>7. Create Post Only for your RSS Subscribers</h4>
<p>If you would like to give an exclusive offer to your regular RSS subscribers, here&#8217;s a nice trick to create a post that is only visible to your RSS subscribers. </p>
<p>First of all, create a category that will hold posts to show to your RSS suscribers. For example, create a category <em>&#8216;RSS&#8217; </em> and add some posts exclusively to it. Note down the category ID of this category. Now in your theme&#8217;s <em>functions.php</em> file, add these lines of code so that it is only shown to RSS subscribers.</p>
<pre name="code" class="php" >
&lt;?php
function excludeCategory($query)
{
	if($query-&gt;is_home | $query-&gt;is_archive )
	//Exclude category from all other pages except RSS
	$query-&gt;set('cat','-3');
	return $query;
}
add_filter('pre_get_posts', 'excludeCategory');
?&gt;
</pre>
<p><em>Source:</em> <a href="http://webdeveloperplus.com/wordpress/create-post-only-for-your-rss-subscribers-in-wordpress/" >Create Post only for your RSS Subscribers</a></p>
<h4>8. Get Rid of Curly quotes</h4>
<p>WordPress usually replaces pair of double quotes with curly quotes e.g. &quot;something&quot; will become “something”. This is fine for most of the blogs and they look nice too but if you post source code in your posts, then you need to disable this functionality as it&#8217;ll also transform quotes within source code. Paste this code into your theme&#8217;s <em>functions.php</em> file.</p>
<pre name="code" class="php" >
&lt;?php remove_filter('the_content', 'wptexturize'); ?&gt;
</pre>
<p><em>Source:</em> <a href="http://www.wprecipes.com/how-to-get-rid-of-curly-quotes-in-your-wordpress-blog" >Get rid of Curly Quotes in WordPress Blog &#8211; WpRecipes</a></p>
<h4>9. Deny Comment Posting to Spammers</h4>
<p>You can keep a good number of spam comments away from your blog by checking the referrer URL of the posted comment form. Most of the spam comments are usually made by automated scripts and they just post the data to <em>wp-comments-post.php</em> so that there&#8217;s no referral URL through which form is submitted.<br />
You can add a rule to your blog&#8217;s <em>.htaccess</em> file so that it restricts the access of <em>wp-comments-post.php</em> to requests that provide referral URL.<br />
Here are the rules you need to add to .htaccess file. <strong>Do backup .htaccess file before modifying.</strong></p>
<pre name="code" class="php" >
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*yourblog.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
</pre>
<p><em>Source:</em> <a href="http://www.wprecipes.com/how-to-deny-comment-posting-to-no-referrer-requests" >How To Deny Comment Posting to no referrer requests &#8211; WpRecipes</a></p>
<p><em>Note:</em> This will only prevent spam bots or automated scripts from posting comment and not those individuals that manually post them. You should use Akismet or other spam preventing tools in addition to this.</p>
<h4>10. Insert Ads Within RSS Feed</h4>
<p>Here&#8217;s a nice hack to add any HTML content into RSS Feeds like ads, copyright info or anything you want to show to just your RSS readers. Add this code to your theme&#8217;s <em>functions.php</em> file and you can customize the HTML content to anything you want to append or prepend to posts.</p>
<pre name="code" class="php" >
&lt;?php
function insertAds($content) {
    $content = $content.'&lt;hr /&gt;&lt;a href=&quot;http://webdeveloperplus.com&quot;&gt;Visit WebDeveloper Plus for latest Web Design/Development Information&lt;/a&gt;';
    return $content;
}
add_filter('the_excerpt_rss', 'insertAds');
add_filter('the_content_rss', 'insertAds');
?&gt;
</pre>
<p><em>Source:</em> <a href="http://www.webinventif.fr/wordpress-ajouter-du-contenu-dans-son-flux/" >Web Invent If</a></p>
<h4>11. Disable WordPress Feeds</h4>
<p>If you are using WordPress as CMS which has just static content, then you might want to disable RSS feeds as it won&#8217;t be of any use for your users. Add this code to your <em>functions.php</em> file to disable RSS feeds.</p>
<pre name="code" class="php" >
function fb_disable_feed() {
	wp_die( __('No feed available,please visit our &lt;a href=&quot;'. get_bloginfo('url') .'&quot;&gt;homepage&lt;/a&gt;!') );
}

add_action('do_feed', 'fb_disable_feed', 1);
add_action('do_feed_rdf', 'fb_disable_feed', 1);
add_action('do_feed_rss', 'fb_disable_feed', 1);
add_action('do_feed_rss2', 'fb_disable_feed', 1);
add_action('do_feed_atom', 'fb_disable_feed', 1);
</pre>
<p><em>Source:</em> <a href="http://wpengineer.com/disable-wordpress-feed/" >Disable WordPress Feed &#8211; WpEngineer</a></p>
<h4>12. Link Post Title to External URL</h4>
<p>If you sometimes share just a link to other article out there which your readers might find useful, then here&#8217;s a nice hack to link the title of the post in your main template directly to the external URL. This will save your readers some time as they won&#8217;t have to open the post page just to find the resource link. Here&#8217;s how to do it:<br />
Add these lines of code to <em>functions.php</em> file.</p>
<pre name="code" class="php" >
function print_post_title() {
	global $post;
    $thePostID = $post-&gt;ID;
    $post_id = get_post($thePostID);
    $title = $post_id-&gt;post_title;
    $perm = get_permalink($post_id);
    $post_keys = array(); $post_val = array();
    $post_keys = get_post_custom_keys($thePostID);

    if (!empty($post_keys)) {
		foreach ($post_keys as $pkey) {
			if ($pkey=='title_url') {
				$post_val = get_post_custom_values($pkey);
			}
		}
		if (empty($post_val)) {
			$link = $perm;
		} else {
			$link = $post_val[0];
		}
    } else {
		$link = $perm;
    }
    echo '&lt;h2&gt;&lt;a href=&quot;'.$link.'&quot; rel=&quot;bookmark&quot; title=&quot;'.$title.'&quot;&gt;'.$title.'&lt;/a&gt;&lt;/h2&gt;';
}
</pre>
<p>Next, you need to find out following lines in your theme&#8217;s <em>index.php</em> file:</p>
<pre name="code" class="php" >
&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
</pre>
<p>Replace these lines with the following</p>
<pre name="code" class="php" >
&lt;?php print_post_title() ?&gt;
</pre>
<p>Now whenever you want to share an external URL, add a custom field to your post named <em>title_url</em> and set its value as the URL of the resource.<br />
<em>Source:</em> <a href="http://www.wpbeginner.com/wp-tutorials/how-to-link-to-external-links-from-the-post-title-in-wordpress/" >WPBeginner</a></p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/create-post-only-for-your-rss-subscribers-in-wordpress/' rel='bookmark' title='Create Post Only For Your RSS Subscribers in WordPress'>Create Post Only For Your RSS Subscribers in WordPress</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/' rel='bookmark' title='How To Use Thumbnails Generated By WordPress In Your Theme'>How To Use Thumbnails Generated By WordPress In Your Theme</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/' rel='bookmark' title='How To: AJAXify WordPress Comment Posting'>How To: AJAXify WordPress Comment Posting</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/12-lesser-known-but-useful-wordpress-hacks/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>10 Ways To Make Your Blog&#8217;s Comment Form Stand Out</title>
		<link>http://webdeveloperplus.com/design/10-ways-to-make-your-blogs-comment-form-stand-out/</link>
		<comments>http://webdeveloperplus.com/design/10-ways-to-make-your-blogs-comment-form-stand-out/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 15:41:58 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[html form]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/?p=430</guid>
		<description><![CDATA[WordPress comment form is usually the left out portion of most blog designs. Most blog designers do not care to make the comment form unique and stylish but just create it in a hurry. Here are 10 ways with examples to make your blog&#8217;s comment form stand out from the crowd. 1. Change the Layout [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress comment form is usually the left out portion of most blog designs. Most blog designers do not care to make the comment form unique and stylish but just create it in a hurry. Here are 10 ways with examples to make your blog&#8217;s comment form stand out from the crowd.<br />
<span id="more-430"></span></p>
<h3>1. Change the Layout</h3>
<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/09/WordPress-Comment-Form.png" alt="WordPress Comment Form" title="WordPress Comment Form" width="466" height="337" class="largepostimage" /><br />
Most wordpress theme developers do not give much thought into changing the layout of comment form and usually use the same layout as in the default wordpress theme. By creating a different layout of comment form, you can make your blog stand out from the crowd. Here are some nice comment form layouts you can get inspiration from to create a different and unique layout for your net blog design.</p>
<h4>Name, Email, URL in line</h4>
<p><a href="http://www.labnol.org"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/labnol-comment-form.png" title="Name, Email, URL at top inline" class="largepostimage" width="556" height="362" /></a></p>
<h4>Name, Email, URL in line at bottom</h4>
<p><a href="http://corp.viewzi.com/index.php/v2/blog"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/Viewzi-Comment-Form.png" title="Name Email URL to the bottom in line" class="alignnone" width="619" height="296" /></a></p>
<h4>Name, Email, URL to right</h4>
<p><a href="http://jontangerine.com/"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/jontan-comment-form.png" title="Comment Form With Name, Email, URL to right" class="largepostimage" width="620" height="256" /></a></p>
<h4>Name, Email, URL to the left</h4>
<p><a href="http://blog.popstalin.com/"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/popstalin-comment-form.png" title="Name, Email URL to left" class="largepostimage" width="620" height="290" /></a></p>
<h4>Name, Email, URL after comment area</h4>
<p><a href="http://net.tutsplus.com"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/nettuts-comment-form.png" title="Name URL Email after comment area" class="largepostimage" width="613" height="394" /></a></p>
<h3>2. Using tabindex</h3>
<p>tabindex is the attribute for form elements using which you can decide the tab order that is where to focus next when user presses tab to proceed to next input field. By default, tab index will be the order in which input fields are present in html code. But if you change the layout, it will be better to specify tabindex attribute with input fields.</p>
<p><img src="http://static.webdeveloperplus.com/uploads/2009/09/taborder.png" alt="tabindex in form fields" title="tabindex in form fields" width="580" height="137" class="largepostimage" /></p>
<h3>3. Use label and fieldset</h3>
<p>The comment forms should be accessible to all, even those who use screen readers, they should be able to comment on your blog. <em>label</em> and <em>fieldset</em> tags make your comment form more accessible as screen readers use information in label tag to specify input fields.<br />
<img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/labels-fieldsets.png" title="label and fieldset tags" class="largepostimage" width="617" height="124" /></p>
<h3>4. Highlight Field in Focus</h3>
<p><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/hightlight-field-in-focus.png" title="Highlight Field in Focus" class="largepostimage" width="606" height="301" /><br />
Highlighting the input field currently in focus makes your comment form more usable. You can use the <code>:focus</code> pseudo CSS selector to define styles for highlighting field in focus.<br />
But the CSS technique does not work everywhere as older versions of IE do not recognize <code>:focus</code> pseudo selector. For that You can use JavaScript. Here&#8217;s the sample code in jQuery to highlight field in focus.</p>
<pre name="code" class="js" >
$('input').focus(function(){
	$(this).css('border-color', '#000');
})
.blur(function(){
	$(this).css('border-color', '#666');
});
</pre>
<h3>5. Add a Formatting Toolbar to Comment textarea</h3>
<p><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/tinymce-comments.jpg" title="WYSIWIG Comment Editor" class="largepostimage" width="500" height="334" /><br />
This one is not that necessary but if you want to enhance user experience by providing them with options to format their comment, you should consider adding a WYSIWIG text editor toolbar to your comment textarea. Here&#8217;s a nice plugin called <a href="http://wordpress.org/extend/plugins/tinymcecomments">TinyMCE Comments</a> that utilizes the same editor which is used in WordPress Admin area.</p>
<h3>6. Let Users Subscribe To Comments</h3>
<p>This is a must have feature for any WordPress blog as it lets users know if anyone has replied to their comment or added some useful information to the article. You  can use <a href="http://txfx.net/code/wordpress/subscribe-to-comments/">Subscribe to Comments</a> WordPress plugin to add this functionality.</p>
<h3>7. Show Errors Instantly</h3>
<p>In WordPress, if comment form data has some errors, users are taken to a new page that only displays error message and nothing else. As a result user has to click back button and sometimes comment data is lost which will have to be typed again.</p>
<p>It is always a nice idea to have form validation on the spot using JavaScript and display error messages to user as he leaves a particular field rather than form posting back to server and then coming out with errors. Here&#8217;s a nice tutorial on adding <a href="http://net.tutsplus.com/tutorials/wordpress/adding-form-validation-to-wordpress-comments-using-jquery/">form validation with jQuery</a>.</p>
<p><img alt="On the spot Form Validation" src="http://static.webdeveloperplus.com/uploads/2009/09/comment-form-validation.png" title="Comment Form Validation using JavaScript" class="largepostimage" width="453" height="170" /></p>
<h3>8. Preview Comments</h3>
<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/09/Live-Comment-Preview.png" alt="Comment Preview" title="Comment Preview" width="474" height="295" class="largepostimage" /><br />
Letting the user have a chance to see what they are about to post prevents not only spell mistakes or grammatical errors but also gives them a chance to have a second thought over what they have written. There are some nice plugins like <a href="http://wordpress.org/extend/plugins/live-comment-preview/">Live Comment Preview</a> to add this type of feature into WordPress comment form.<br />
But the question is not only the preview functionality but also where the preview will be shown, Lorelle VanFossen has written a good tutorial about <a href="http://lorelle.wordpress.com/2006/04/01/comment-live-preview-placement/">live comment preview position</a>.</p>
<h3>9. Edit Comment After Posting</h3>
<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/09/AJAX-Edit-Comments.jpg" alt="AJAX Edit Comments" title="AJAX Edit Comments" width="353" height="100" class="largepostimage" /><br />
An option to edit comment after posting will certainly make your site more usable as user will have the option to correct any mistakes in the comment text or it is possible that user has changed his mind and wants to change or add something to the comment. <a href="http://wordpress.org/extend/plugins/wp-ajax-edit-comments/">WP AJAX Edit Comments</a> plugin for WordPress will give users an option to edit their comments within set time interval after posting comment.</p>
<h3>10. Spice Up With Graphics</h3>
<p>Using some fancy graphics to style your comment form will give it a unique appearance and brand. Moreover, graphics say more than words and will help catch user attention and will motivate them to comment on your blog. Here are some spicy comment forms with appropriate use of graphics.</p>
<p><a href="http://www.madfrogdesigns.com/"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/Malfrog-designs-comment-form.jpg" title="Malfrog Designs Comment Form" class="largepostimage" width="546" height="411" /></a></p>
<p><a href="http://designdisease.com/blog/"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/design-disease.jpg" title="Design Disease Comment Form" class="largepostimage" width="546" height="234" /></a></p>
<p><a href="http://css-tricks.com/"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/css-tricks-comment-form.jpg" title="CSS Tricks Comment Form" class="largepostimage" width="546" height="313" /></a></p>
<p><a href="http://ma.tt/"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/MATT-Comment-form.jpg" title="ma.tt Comment Form" class="largepostimage" width="546" height="245" /></a></p>
<p><a href="http://taufiq-ridha.co.cc"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/taufiq-ridha.jpg" title="Taufiq Ridha Comment Form" class="largepostimage" width="546" height="322" /></a></p>
<p><a href="http://www.komodomedia.com/blog/"><img alt="" src="http://static.webdeveloperplus.com/uploads/2009/09/komodo-media.jpg" title="Komodo Media comment form design" class="largepostimage" width="546" height="437" /></a></p>
<p>That&#8217;s It! With a litlle thought and time, you can make your blog&#8217;s comment form more usable and enhance the user experience.</p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/free-wordpress-theme-for-personal-blogs-youare/' rel='bookmark' title='Free WordPress Theme For Personal Blogs &#8211; YouAre'>Free WordPress Theme For Personal Blogs &#8211; YouAre</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/' rel='bookmark' title='How To: AJAXify WordPress Comment Posting'>How To: AJAXify WordPress Comment Posting</a></li>
<li><a href='http://webdeveloperplus.com/jquery/ajax-multiple-file-upload-form-using-jquery/' rel='bookmark' title='AJAX Multiple File Upload Form Using jQuery'>AJAX Multiple File Upload Form Using jQuery</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/design/10-ways-to-make-your-blogs-comment-form-stand-out/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Free WordPress Theme For Personal Blogs &#8211; YouAre</title>
		<link>http://webdeveloperplus.com/wordpress/free-wordpress-theme-for-personal-blogs-youare/</link>
		<comments>http://webdeveloperplus.com/wordpress/free-wordpress-theme-for-personal-blogs-youare/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 05:34:31 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[personal blog]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/?p=339</guid>
		<description><![CDATA[If you are looking for a sleek, minimalist and professional theme for your personal WordPress blog, then YouAre WordPress theme can be a nice solution. It is a free minimalist, sleek and professional looking WordPress theme that lets you promote your true self.]]></description>
			<content:encoded><![CDATA[<p>If you are looking for a sleek, minimalist and professional theme for your personal WordPress blog, then <a href="http://wptheme.youare.com/" target="_blank" >YouAre</a> WordPress theme can be a nice solution. It is a free minimalist, sleek and professional looking WordPress theme that lets you promote your true self.</p>
<p><img class="largepostimage" title="YouAre WordPress Theme" src="http://webdeveloperplus.com/wp-content/uploads/2009/09/YouAre-WordPress-Theme.jpg" alt="YouAre WordPress Theme" width="600" height="303" /></p>
<p><a href="http://wptheme.youare.com/demo/" title="Demo" target="_blank" ><strong>Demo</strong></a> <a href="http://wptheme.youare.com/youare.zip" title="Download YouAre Theme" ><strong>Download</strong></a></p>
<p>Here are some of the features of this nice theme:</p>
<p>1.<strong> Multiple Color Schemes</strong><br />
<img src="http://webdeveloperplus.com/wp-content/uploads/2009/09/YouAre-Color-Schemes.jpg" alt="YouAre Color Schemes" title="YouAre Color Schemes" width="630" height="399" class="largepostimage" /><br />
You can select an alternate stylesheet from the theme options panel to change the look. By default, it has five different color schemes. You can also create your own and place it in YouAre Theme folder and it&#8217;ll automatically load in the stylesheet options.</p>
<p>2. Latest Twitter and YouAre Updates on Homepage and sidebar.</p>
<p>3. Total Feedburner Management (Username, Feed Counter, Email Subscription)<br />
<img src="http://webdeveloperplus.com/wp-content/uploads/2009/09/feedburner-integration.jpg" alt="feedburner integration" title="feedburner integration" width="630" height="270" class="largepostimage" /></p>
<p>4. <strong>Flickr Badge :</strong> Show latest flickr pics in the sidebar by just entering your flickr username in theme options.</p>
<p>5. Your Photo in About Page</p>
<p>6. Author Summary in the sidebar.</p>
<p>7. Footer Promo Section &#8211; Show off your featured work or write a promo about your company.</p>
<p>8. SEO Optimized Code (meta, canonical, dynamic h1 tags…)</p>
<p>9. Multi-language support with automatic user language detection (wp-config.php): English, Spanish and Catalan.</p>
<p>10. Gravatar ready. Header auto recognition gravatar</p>
<p>11. Widget ready: supports widgets in sidebar</p>
<p>12. Threaded-replies</p>
<p>13. Edit/Delete/Mark as spam link on comments</p>
<p>14. Print ready post pages.</p>
<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/09/print-accessibility.jpg" alt="Print Posts" title="Print Posts" width="630" height="241" class="largepostimage" /></p>
<p>15. Accessibility Features (access keys, pdf and zip icons to provide information to user about hyperlink)</p>
<h3>Requirements</h3>
<p>To use YouAre WordPress Theme to its full potential, you&#8217;ll need to install and activate some plugins which are included in the download package. Two of them <a href="http://scribu.net/wordpress/smart-archives-reloaded" >Smart Archives Reloaded</a> and <a href="http://www.jenst.se/2008/03/29/wp-page-numbers" >WP Page Numbers</a> are required while rest are recommended but optional to use.</p>
<p>You can set your personal blog up in no time using this theme as does not require any theme editing, just upload all the plugins to plugins folder and theme files to themes folder and then just activate the plugins, theme and modify the theme options as you want them to be.<br />
<a href="http://wptheme.youare.com/demo/" title="Demo" target="_blank" ><strong>Demo</strong></a> <a href="http://wptheme.youare.com/youare.zip" title="Download YouAre Theme" ><strong>Download</strong></a> <a href="http://wptheme.youare.com/" ><strong>Visit Theme Page</strong></a></p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/23-excellent-tutorials-for-wordpress-theme-developers/' rel='bookmark' title='23+ Excellent Tutorials For WordPress Theme Developers'>23+ Excellent Tutorials For WordPress Theme Developers</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/' rel='bookmark' title='How To Use Thumbnails Generated By WordPress In Your Theme'>How To Use Thumbnails Generated By WordPress In Your Theme</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/new-wordpress-plugin-wdp-ajax-comments/' rel='bookmark' title='New WordPress Plugin: WDP AJAX Comments'>New WordPress Plugin: WDP AJAX Comments</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/free-wordpress-theme-for-personal-blogs-youare/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New WordPress Plugin: WDP AJAX Comments</title>
		<link>http://webdeveloperplus.com/wordpress/new-wordpress-plugin-wdp-ajax-comments/</link>
		<comments>http://webdeveloperplus.com/wordpress/new-wordpress-plugin-wdp-ajax-comments/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 13:28:57 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ajax comments]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/?p=242</guid>
		<description><![CDATA[Today, I am proud to release my first WordPress plugin named &#8220;WDP AJAX Comments&#8221;. This plugin will enable AJAX Comments on your WordPress Blog and enhance the user experience using nifty on page comment form submission and validation of input before submission. Features Enable AJAX Commenting Client Side Form Validation Easily rolls back if JS [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I am proud to release my first WordPress plugin named <strong>&#8220;WDP AJAX Comments&#8221;</strong>. This plugin will enable <a href="http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/">AJAX Comments</a> on your WordPress Blog and enhance the user experience using nifty on page comment form submission and validation of input before submission.<br />
<span id="more-242"></span></p>
<h3>Features</h3>
<ul>
<li>Enable AJAX Commenting</li>
<li>Client Side Form Validation</li>
<li>Easily rolls back if JS disabled</li>
<li>Easily configure custom styles for messages</li>
</ul>
<h3>Download</h3>
<p><a href="http://wordpress.org/extend/plugins/wdp-ajax-comments/" ><strong>Download the Plugin</strong></a> from official WordPress Plugin repository.</p>
<h3>Installing &#038; Activating</h3>
<p>Here&#8217;s how to install and use this plugin to its full potential:<br />
1. Firstly, go to <em>Add New Plugin</em> in your WordPress admin panel, and search for <em>wdp ajax comments</em> and you&#8217;ll see the listing, install the plugin by clicking on <em>&#8216;Install&#8217;</em>. Or you can go to <a href="http://wordpress.org/extend/plugins/wdp-ajax-comments/" target="_blank">WordPress plugin repository page</a> and download the plugin and extract it in your <em>wp-content/plugins</em> folder.<br />
2. Now activate this plugin, and your blog is ready with AJAX comment posting, but one thing you still need to do is enabling the client side comment form validation.<br />
3. To enable form validation, refer to the below section.</p>
<h3>Enabling Comment Form Validation</h3>
<p>This plugin makes use of jQuery Validation plugin to validate comment form, so you will need to add some css classes to your comment form. Here&#8217;s how to do that:<br />
1. Open up your theme&#8217;s <strong>comments.php</strong> file in an editor.<br />
2. Find out the code lines where comment form starts.<br />
3. Now, you need to add following CSS classes to comment form inputs:</p>
<ul>
<li>To comment author name input, add <code>class="required"</code></li>
<li>To comment author email input, add <code>class="required email"</code></li>
<li>To comment author URL input, add <code>class="url"</code></li>
<li>To the comment textarea, add <code>class="required"</code></li>
</ul>
<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/08/ajax-comments-wordpress.png" alt="modify comment form" title="modify comment form" width="635" height="202" class="largepostimage" /></p>
<p>4. Save the file and now your comment form validation will work.</p>
<h3>Styling The Messages</h3>
<p>WDP AJAX Comments provides you with full control over the looks of various messages using CSS. To define your own styles, create a new stylesheet file named <em>wdp-ajax-styles.css</em> in your theme&#8217;s folder and define styles for these classes:</p>
<ul>
<li><code>.wdpajax-error</code> This class is used for the message shown when AJAX error is encountered.</li>
<li><code>.wdpajax-success</code> This class is used for success message shown after successful comment submission.</li>
<li><code>.wdpajax-loading</code> This class is used to show the &#8216;Processing..&#8217; message while performing AJAX request. You can add animated loading gif&#8217;s as background to give a nice AJAX effect.</li>
<li><code>label.error</code> This class is used to show validation errors.</li>
</ul>
<p>If your theme folder does not contain <em>wdp-ajax-styles.css</em> file, the default stylesheet of the plugin will be used.</p>
<h3>Demo</h3>
<p>If you would like to see the demo, go to the <a href="http://demo.webdeveloperplus.com/wordpress/" title="View Demo" target="_blank" ><strong>demo page</strong></a>.</p>
<h3>What to Expect in Coming Versions</h3>
<p>Currently, this plugin just AJAXifies comment submission and does not update the comments displayed automatically. So, this is one of the feature you should expect in coming editions. Another feature i have thought is giving you control over the messages displayed on AJAX requests.</p>
<p>If you would like to suggest a new feature, feel free to comment below, just prepend your comment with <strong>Suggestion</strong>.</p>
<p>If you have used this plugin on your blog, post the address of your blog too, so that other can have a look.<br />
In case you need any assistance, feel free to use the comment section below</p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/' rel='bookmark' title='How To: AJAXify WordPress Comment Posting'>How To: AJAXify WordPress Comment Posting</a></li>
<li><a href='http://webdeveloperplus.com/design/10-ways-to-make-your-blogs-comment-form-stand-out/' rel='bookmark' title='10 Ways To Make Your Blog&#8217;s Comment Form Stand Out'>10 Ways To Make Your Blog&#8217;s Comment Form Stand Out</a></li>
<li><a href='http://webdeveloperplus.com/jquery/ajax-multiple-file-upload-form-using-jquery/' rel='bookmark' title='AJAX Multiple File Upload Form Using jQuery'>AJAX Multiple File Upload Form Using jQuery</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/new-wordpress-plugin-wdp-ajax-comments/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>How To: AJAXify WordPress Comment Posting</title>
		<link>http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/</link>
		<comments>http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 12:51:13 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ajax comments]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/?p=226</guid>
		<description><![CDATA[There are tons of WordPress Tutorials out there, but i haven&#8217;t found a single one that explains how to AJAX-ify WordPress comment posting on blog posts. Though there are some plugins for AJAX comments, but none seem to work with WordPress 2.8 or later versions. Today i will show you how to enable AJAX comments [...]]]></description>
			<content:encoded><![CDATA[<p>There are tons of WordPress Tutorials out there, but i haven&#8217;t found a single one that explains how to AJAX-ify WordPress comment posting on blog posts. Though there are some plugins for AJAX comments, but none seem to work with WordPress 2.8 or later versions. </p>
<p>Today i will show you how to enable AJAX comments with client side JavaScript comment form validation on your WordPress blog step by step that should work with most versions of WordPress. We&#8217;ll be modifying the WordPress theme files to do that. In few days, i&#8217;ll be releasing a WordPress plugin that will automatically enable AJAX Comments. So, do subscribe to our <a href="http://feeds2.feedburner.com/WebDeveloperPlus" title="Subscribe via RSS" >RSS Feed</a> or <a href="http://feedburner.google.com/fb/a/mailverify?uri=WebDeveloperPlus&#038;loc=en_US" target="_blank" >e-mail updates</a> so that you are the first to know about it.</p>
<p>Let&#8217;s start with it.</p>
<h3>Functions.php file</h3>
<p>Add the following lines of code to your theme&#8217;s <em>functions.php</em> file. If your theme doesn&#8217;t have one, then create a new file and add it to your theme folder.</p>
<pre name="code" class="php" >
add_action('init', 'wdp_ajaxcomments_load_js', 10);
function wdp_ajaxcomments_load_js(){
		wp_enqueue_script('ajaxValidate', get_stylesheet_directory_uri().'/wdp-ajaxed-comments/js/jquery.validate.min.js', array('jquery'), '1.5.5');
		wp_enqueue_script('ajaxcomments', get_stylesheet_directory_uri().'/wdp-ajaxed-comments/js/ajax-comments.js',	array('jquery', 'ajaxValidate'), '1.1');
}
add_action('comment_post', 'wdp_ajaxcomments_stop_for_ajax',20, 2);
function wdp_ajaxcomments_stop_for_ajax($comment_ID, $comment_status){
	if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
	//If AJAX Request Then
		switch($comment_status){
			case '0':
				//notify moderator of unapproved comment
				wp_notify_moderator($comment_ID);
			case '1': //Approved comment
				echo &quot;success&quot;;
				$commentdata=&amp;get_comment($comment_ID, ARRAY_A);
				$post=&amp;get_post($commentdata['comment_post_ID']); //Notify post author of comment
				if ( get_option('comments_notify') &amp;&amp; $commentdata['comment_approved'] &amp;&amp; $post-&gt;post_author != $commentdata['user_ID'] )
					wp_notify_postauthor($comment_ID, $commentdata['comment_type']);
				break;
			default:
				echo &quot;error&quot;;
		}
		exit;
	}
}
</pre>
<p><strong>Code Explanation</strong>: Firstly, we load required JavaScript files jQuery, jQuery Validation and ajax-comments.js using the <code>wp_enqueue_script()</code> function. <code>wp_enqueue_script()</code> accepts four parameters.</p>
<ul>
<li>First is the name of the handler for JavaScript file, you can use any name here for your own custom JavaScript, but for files that wordpress include by default like jQuery, there are pre-fixed handlers like &#8216;jquery&#8217;.</li>
<li>Second parameter is path to JavaScript file.</li>
<li>Third parameter is the array of name of handlers of JavaScript files, which must be loaded before the specified file.</li>
<li>Last is the version number of JavaScript file which you should use in case you use caching on your blog.</li>
</ul>
<p>The function <code>wdp_ajaxcomments_stop_for_ajax()</code> hooks onto the comment_post action which is triggered after a comment has been successfully added to the database. normally, what happens when you post a comment is that you are redirected back to the original post, but since we will be using AJAX, we don&#8217;t want a redirect but a message about the status of comment posted.</p>
<p>I recently read a nice post from David Walsh where he told about <a href="http://davidwalsh.name/detect-ajax" target="_blank">how to identify AJAX requests</a> using <code>$_SERVER["HTTP_X_REQUESTED_WITH"]</code> which is populated by most JavaScript frameworks like in our case jQuery.<br />
I used it to hook into <code>comment_post</code> and check whether it is AJAX request or normal request. If it is AJAX request then check the status of comment, if it is unapproved or approved, a message <em>&#8216;success&#8217;</em> is output and moderator or post author is notified accordingly.<br />
After identifying AJAX request, i stopped the script execution using <code>exit</code> statement so as to prevent the redirect.<br />
Now rest is the job of JavaScript code.</p>
<h3>The JavaScript Code</h3>
<p>You will need to add two JavaScript files <em>jquery.validate.min.js</em> and <em>ajax-comments.js</em> in the <em>js</em> directory of your theme(Files are available at the end of article). Create the <em>js</em> directory and add files if it does not exist. Though jQuery is required to work, but since it is included in WordPress by default, it will automatically be loaded as we specified it as a requirement while loading JavaScript files in <em>functions.php</em>.</p>
<p><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">jQuery Validation plugin</a> is used to validate comment form data.<br />
Here&#8217;s the code and explanation for <em>ajax-comments.js</em>.</p>
<pre name="code" class="js" >
jQuery('document').ready(function($){
	var commentform=$('form[action$=wp-comments-post.php]');
	commentform.prepend('&lt;div id=&quot;wdpajax-info&quot; &gt;&lt;/div&gt;');
	var infodiv=$('#wdpajax-info');
	commentform.validate({
		submitHandler: function(form){
			//serialize and store form data in a variable
			var formdata=commentform.serialize();
			//Add a status message
			infodiv.html('&lt;p&gt;Processing...&lt;/p&gt;');
			//Extract action URL from commentform
			var formurl=commentform.attr('action');
			//Post Form with data
			$.ajax({
				type: 'post',
				url: formurl,
				data: formdata,
				error: function(XMLHttpRequest, textStatus, errorThrown){
					infodiv.html('&lt;p class=&quot;wdpajax-error&quot; &gt;You might have left one of the fields blank.&lt;/p&gt;');
				},
				success: function(data, textStatus){
					if(data==&quot;success&quot;)
						infodiv.html('&lt;p class=&quot;wdpajax-success&quot; &gt;Thanks for your comment. We appreciate your response.&lt;/p&gt;');
					else
						infodiv.html('&lt;p class=&quot;wdpajax-error&quot; &gt;Error in processing your form.&lt;/p&gt;');
					commentform.find('textarea[name=comment]').val('');
				}
			});
		}
	});
});
</pre>
<p><strong>Code Explanation:</strong> Firstly, we append a div to comment form that will show AJAX status messages. Then we intialize jQuery Validation on comment form and if validation is successful, we will use jQuery AJAX to send the form data to the action URL of comment form and display a message accordingly.</p>
<p>Now, uptill here, if you have followed along and worked as told, you&#8217;ll find that AJAX comment posting works but validation doesn&#8217;t. Since, we are using jQuery Validation plugin, you will have to now edit the theme&#8217;s comments.php file.</p>
<h3>Enable Comment Form Validation</h3>
<p>Open your theme&#8217;s comments.php and add some CSS classes to comment form input fields as described:</p>
<ul>
<li>To comment author name input, add <code>class=&quot;required&quot;</code></li>
<li>To comment author email input, add <code>class=&quot;required email&quot;</code></li>
<li>To comment author URL input, add <code>class=&quot;url&quot;</code></li>
<li>To the comment textarea, add <code>class=&quot;required&quot;</code></li>
</ul>
<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/08/ajax-comments-wordpress.png" alt="Modify comments.php file" title="Modify comments.php file" width="635" height="202" class="largepostimage" /></p>
<p>Now the comment form validation should work. But it might be having awkward looks or styles, now the last step is to customize the looks of messages using CSS.</p>
<h3>Customize the Styles of Messaages</h3>
<p>The error messages from validation use labels with CSS class <em>error</em>. While the AJAX post request status messages use two CSS classes, wdpajax-success for AJAX success and wdpajax-error for error message. Define the styles for these classes in your theme&#8217;s stylesheet file. Here&#8217;s what i have used:</p>
<pre name="code" class="css" >
.wdpajax-error{
	border:1px solid #f9d9c9;
	padding:5px;
	color:#ff3311;
}
.wdpajax-success{
	border:1px solid #339933;
	padding:5px;
	color:#339933;
}
label.error{
	float:none !important;
	padding-left:5px;
	color:#ff3311;
}
</pre>
<p>There you are with cool AJAX comments on your WordPress Blog.<br />
<img src="http://webdeveloperplus.com/wp-content/uploads/2009/08/wdp-ajax-comments-wordpress.png" alt="AJAx WordPress Comments" title="AJAx WordPress Comments" width="520" height="379" class="largepostimage" /></p>
<p><a href="http://demo.webdeveloperplus.com/wordpress/" target="_blank" ><strong>Click here to view the Live demo</strong></a>(Try commenting on one of the posts).</p>
<p>To download the required files, <a href="http://demo.webdeveloperplus.com/source-code/wdp-ajaxcomments-theme-files.zip" target="_blank" ><strong>Click here</strong></a><br />
If you find any problems or error, do let me know in comments.</p>
<h3>Plugin</h3>
<p>If you find modifying theme file difficult, or if you regularly change your blog&#8217;s theme then it will be difficult for you to modify theme files every-time you apply a new theme. so, i have created a plugin named <a href="http://webdeveloperplus.com/wordpress/new-wordpress-plugin-wdp-ajax-comments/"><strong>WDP AJAX Comments</strong></a> that will automatically add AJAX commenting to your blog.<br />
So, do subscribe to our <a href="http://feeds2.feedburner.com/WebDeveloperPlus" title="Subscribe via RSS" >RSS Feed</a> or <a href="http://feedburner.google.com/fb/a/mailverify?uri=WebDeveloperPlus&#038;loc=en_US" target="_blank" >email updates</a> so that you are among the first one to get the plugin.<br />
Enjoy!</p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/new-wordpress-plugin-wdp-ajax-comments/' rel='bookmark' title='New WordPress Plugin: WDP AJAX Comments'>New WordPress Plugin: WDP AJAX Comments</a></li>
<li><a href='http://webdeveloperplus.com/design/10-ways-to-make-your-blogs-comment-form-stand-out/' rel='bookmark' title='10 Ways To Make Your Blog&#8217;s Comment Form Stand Out'>10 Ways To Make Your Blog&#8217;s Comment Form Stand Out</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/12-lesser-known-but-useful-wordpress-hacks/' rel='bookmark' title='12 Lesser Known But Useful WordPress Hacks'>12 Lesser Known But Useful WordPress Hacks</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>23+ Excellent Tutorials For WordPress Theme Developers</title>
		<link>http://webdeveloperplus.com/wordpress/23-excellent-tutorials-for-wordpress-theme-developers/</link>
		<comments>http://webdeveloperplus.com/wordpress/23-excellent-tutorials-for-wordpress-theme-developers/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 09:13:16 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/?p=194</guid>
		<description><![CDATA[WordPress is undoubtedly an amazing publishing platform. You can get started as quickly as with few clicks or you can customize it to any level you want. The internet is filled with good quality tutorials on customizing every aspect of WordPress. Here are 23+ excellent tutorials that will help wordpress theme developers make better themes and give them an idea of different and unique ways to customize WordPress according to need.]]></description>
			<content:encoded><![CDATA[<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/08/WordPress.jpg" alt="WordPress" title="WordPress" width="150" height="144" class="alignleft size-full wp-image-219" /> WordPress is undoubtedly an amazing publishing platform. You can get started as quickly as with few clicks or you can customize it to any level you want. The internet is filled with good quality tutorials on customizing every aspect of WordPress. Here are 23+ excellent tutorials that will help wordpress theme developers make better themes and give them an idea of different and unique ways to customize WordPress according to need.</p>
<h4>1. <a href="http://www.problogdesign.com/how-to/how-to-create-a-wordpress-login-form-overlay/" target="_blank" >Create a Login Form Overlay</a></h4>
<p><img src="http://static.webdeveloperplus.com/uploads/2009/08/excellent-wp-resources/login-form-overlay.jpg" width="600px" height="279px" alt="Login form overlay" class="largepostimage" /><br />
Give your users a quick way to login to your WordPress blog in a lightbox window. Quite useful for multi-author blogs or blogs that allow users to login to comment.</p>
<h4>2. <a href=" http://wpcandy.com/articles/tutorials/custom-tweetbacks-with-simple-pie-and-custom-fields.html" target="_blank" >Add Tweets Related To Your Posts in WordPress</a></h4>
<p><img src="http://static.webdeveloperplus.com/uploads/2009/08/excellent-wp-resources/tweets-related-to-post.png" width="559px" height="290px" alt="Tweets Related to Posts" class="largepostimage" /><br />
Awesome tutorial on showing tweets related to your posts from twitter timeline. You can specify the tags or keyword in the custom field which will be used to fetch tweets.</p>
<h4>3. <a href="http://wpshout.com/create-an-awesome-wordpress-theme-options-page-part-1/" target="_blank" >Create an Awesome WordPress Theme Options Page</a></h4>
<p>This is a two part tutorial on how to create an options page for your WordPress Theme to make it stand out from the crowd. </p>
<h4>4.  <a href="http://www.wprecipes.com/wordpress-how-to-get-custom-fields-outside-the-loop" target="_blank" >How To Get Custom Field Outside WordPress Loop</a></h4>
<p>Ever thought of using post custom fields outside the WordPress loop, then use the following code to access custom field, simply replace the &#8216;customfield&#8217; in fourth line with your own custom field.</p>
<pre name="code" class="php" >
&lt;?php
global $wp_query;
$postid = $wp_query-&gt;post-&gt;ID;
echo get_post_meta($postid, 'customField', true);
?&gt;
</pre>
<h4>5. <a href="http://www.catswhocode.com/blog/multiple-wordpress-loops" target="_blank" >Using Multiple WordPress Loops in Your Theme</a></h4>
<p>Sometimes, you might want to show featured posts before the normal posts or you want or you want to format posts from a particular category in a different way from others, then you will have to use multiple wordpress loops in your theme. <a href="http://www.cozmoslabs.com/about/" target="_blank">Cristian Antohe</a> explains everything you need to know about using multiple WordPress loops in your theme.</p>
<h4>6. <a href="http://www.wprecipes.com/how-to-get-the-first-image-from-the-post-and-display-it" target="_blank" >How To Get First Image from post and display it</a></h4>
<p>In most of the premium like themes, first image of the post is given special attention as thumbnail version of it is used on blog homepage, sometimes a more smaller thumbnail in sidebar or footer alongside post listings. Simply paste this function into your theme&#8217;s functions.php file and use the statement <code>&lt;?php echo catch_that_image() ?&gt;</code> in the wordpress loop where you need the first image.</p>
<pre name="code" class="php" >
function catch_that_image() {
  global $post, $posts;
  $first_img = '';
  ob_start();
  ob_end_clean();
  $output = preg_match_all('/&lt;img.+src=[\'&quot;]([^\'&quot;]+)[\'&quot;].*&gt;/i', $post-&gt;post_content, $matches);
  $first_img = $matches [1] [0];

  if(empty($first_img)){ //Defines a default image
    $first_img = &quot;/images/default.jpg&quot;;
  }
  return $first_img;
}
</pre>
<h4>7. <a href="http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/" target="_blank">How To Use Thumbnails Generated By WordPress in Your Theme</a></h4>
<p>WordPress also creates a thumbnail version of each image you upload inside wordpress post whose size you can alter from <em>Settings > Media</em> in administration panel. Now to use that thumbnail version within your theme, simply use the following code:</p>
<pre name="code" class="php" >
&lt;?php
//Get images attached to the post
$args = array(
	'post_type' =&gt; 'attachment',
	'post_mime_type' =&gt; 'image',
	'numberposts' =&gt; -1,
        'order' =&gt; 'ASC',
	'post_status' =&gt; null,
	'post_parent' =&gt; $post-&gt;ID
);
$attachments = get_posts($args);
if ($attachments) {
	foreach ($attachments as $attachment) {
		$img = wp_get_attachment_thumb_url( $attachment-&gt;ID );
                break;
        }
//Display image
echo '&lt;img src=&quot;'.$img.'&quot; alt="something" /&gt;';
}
?&gt;
</pre>
<p>This one is useful if your theme requires only single sized thumbnail version of the first image, if you require multiple thumbnail versions, then use the method specified by 6th point.</p>
<h4>8. <a href="http://www.wprecipes.com/how-to-list-future-posts" target="_blank" >Display Future Scheduled Posts on Your Blog</a></h4>
<p>Show your readers in advance which posts are you writing and when should they come to see the new post. Add the following code any where in your theme, preferably sidebar to show upcoming scheduled posts.</p>
<pre name="code" class="php" >
&lt;h3&gt;Upcoming Posts&lt;/h3&gt;
&lt;?php query_posts('showposts=5&amp;post_status=future'); ?&gt;
&lt;?php if ( have_posts() ) : ?&gt;
  &lt;ul&gt;
  &lt;?php while ( have_posts() ) : the_post(); ?&gt;
    &lt;li&gt;
        &lt;?php the_title(); ?&gt; &lt;?php edit_post_link('e',' (',')'); ?&gt;&lt;br /&gt;
	&lt;span class=&quot;datetime&quot;&gt;&lt;?php the_time('j. F Y'); ?&gt;&lt;/span&gt;
    &lt;/li&gt;
&lt;?php endwhile; ?&gt;
  &lt;/ul&gt;
&lt;?php endif; ?&gt;
</pre>
<h4>9. <a href="http://www.wprecipes.com/using-cron-to-schedule-events-in-your-wordpress-blog" target="_blank" >Using Cron to Schedule Events in WordPress</a></h4>
<p>You might sometime need to schedule certain events in wordpress like, daily backup of database, send summary report to blog administrator etc, WordPress has the ability to cater to this need too. Simply paste the following code into <em>functions.php</em> file to create a scheduled event.</p>
<pre name="code" class="php" >
if (!wp_next_scheduled('my_task_hook')) {
	wp_schedule_event( time(), 'hourly', 'my_task_hook' );
}

add_action( 'my_task_hook', 'my_task_function' ); 

function my_task_function() {
//code for your scheduled task
	wp_mail('you@yoursite.com', 'Automatic email', 'Hello, this is an automatically scheduled email from WordPress.');
}
</pre>
<h4>10. <a href="http://wphacks.com/how-to-separate-wordpress-comments-and-trackbacks/" target="_blank" >Separate Comments and Trackbacks in WordPress</a></h4>
<p>This tutorial shows you how to separate comments and trackbacks in the comments section. This tutorial uses comments.php file from WordPress 2.5 or earlier which did not have support for <em>wp_list_comments</em> function. With WordPress 2.7 or later, you can simply pass a parameter to <code>wp_list_comments()</code> function to separate comments and trackbacks. e.g.<br />
Use <code>wp_list_comments('type=comment')</code> to show comments and <code>wp_list_comments('type=pings')</code> to show pings and trackbacks.</p>
<h4>11. <a href="http://www.wprecipes.com/list-all-hooked-wordpress-functions" target="_blank" >List All Hooked WordPress Functions</a></h4>
<p>WordPress Hooks are very useful and help developers to customize wordpress the way you want, but some times thing might go wrong and you might want to view all the hooks that are being used, then this tutorial will come handy.</p>
<h4>12. <a href="http://www.nathanrice.net/blog/browser-detection-and-the-body_class-function/" target="_blank" >Detect Visitor Browser Within WordPress</a></h4>
<p>One of the lesser known features of WordPress is that it provides global variables for browser detection which you can use to customize your theme for different browsers. Here&#8217;s a useful function which you can add to your <em>functions.php</em> file that adds browser specific css classes to body tag so that you can control looks for different browsers.</p>
<pre name="code" class="php" >
&lt;?php
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
	global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;

	if($is_lynx) $classes[] = 'lynx';
	elseif($is_gecko) $classes[] = 'gecko';
	elseif($is_opera) $classes[] = 'opera';
	elseif($is_NS4) $classes[] = 'ns4';
	elseif($is_safari) $classes[] = 'safari';
	elseif($is_chrome) $classes[] = 'chrome';
	elseif($is_IE) $classes[] = 'ie';
	else $classes[] = 'unknown';

	if($is_iphone) $classes[] = 'iphone';
	return $classes;
}
?&gt;
</pre>
<h4>13. <a href="http://www.wprecipes.com/get-tags-specific-to-a-particular-category-on-your-wordpress-blog" target="_blank" >Get Tags Specific to a Particular Category in WordPress</a></h4>
<p>Wouldn&#8217;t it be nice to show tags related to the category of the post instead of showing all the tags and eating up page real estate. Here&#8217;s the code that shows only the tags related to a particular category.</p>
<pre name="code" class="php" >
&lt;?php
	query_posts('category_name=work');
	if (have_posts()) : while (have_posts()) : the_post();
        $posttags = get_the_tags();
		if ($posttags) {
			foreach($posttags as $tag) {
				$all_tags_arr[] = $tag -&gt; name; //USING JUST $tag MAKING $all_tags_arr A MULTI-DIMENSIONAL ARRAY, WHICH DOES WORK WITH array_unique
			}
		}
	endwhile; endif; 

	$tags_arr = array_unique($all_tags_arr); //REMOVES DUPLICATES
	echo '&lt;pre&gt;'.print_r($tags_arr, true).'&lt;/pre&gt;'; //OUTPUT FINAL TAGS FROM CATEGORY
?&gt;
</pre>
<h4>14. <a href="http://www.wprecipes.com/fahirsch-asked-how-to-list-all-posts-on-a-page" target="_blank" >Create Archive Page Using WordPress Loop</a></h4>
<p><img src="http://static.webdeveloperplus.com/uploads/2009/08/excellent-wp-resources/wordpress-archive-page.png" width="600px" height="217px" class="largepostimage" alt="Archive Page Using WordPress Loop" /><br />
This is a nice tutorial from WP-Recipes about how to create an archive page for your blog that lists all the posts without installing any plugin. Simply create a custom page template and paste the given code in it and then create a new blank page with its template set to the one with custom code.</p>
<h4>15. <a href="http://justintadlock.com/archives/2009/03/28/get-the-latest-sticky-posts-in-wordpress" target="_blank" >Get The Latest Sticky Posts</a></h4>
<p>One of the useful features in WordPress 2.7 or later is the sticky posts, so if you need to output 5 latest sticky posts using WordPress loop, here&#8217;s the code:</p>
<pre name="code" class="php" >
&lt;?php
$sticky = get_option('sticky_posts');
rsort( $sticky );
$sticky = array_slice( $sticky, 0, 5);
query_posts( array( 'post__in' =&gt; $sticky, 'caller_get_posts' =&gt; 1 ) );
if (have_posts()) :
    while (have_posts()) : the_post();
        the_title();
        the_excerpt();
    endwhile;
endif;
?&gt;
</pre>
<h4>16. <a target="_blank" href="http://www.johnkolbert.com/wordpress/how-to-only-show-posts-with-a-specific-custom-field/" >Only Show Posts With a specific Custom Field Value</a></h4>
<p>You might some time need to show posts having a specific custom field value, then use the code below to get posts in the loop.</p>
<pre name="code" class="php" >
&lt;?php query_posts('meta_key=[custom field name]&amp;meta_value=[custom field value]');  ?&gt;
&lt;?php if (have_posts()) : ?&gt;
&lt;?php while (have_posts()) : the_post(); ?&gt;
    //display posts
&lt;?php endwhile; endif;
?&gt;
</pre>
<h4>17. Use Multiple Loops on a Page Without printing Duplicate Posts</h4>
<p>If you use multiple loops within your theme file, then chances are that some posts might be output by both loops simultaneously. To prevent this, do the following:<br />
When you use loop for first time, record the id&#8217;s of posts in an array e.g.</p>
<pre name="code" class="php" >
&lt;?php
query_posts('showposts=8');
$ids = array();
while (have_posts()) : the_post();
$ids[] = get_the_ID();
the_title();
the_content();
endwhile;
?&gt;
</pre>
<p>And when you use the loop next time, modify your query to exclude the post with id&#8217;s already displayed by first loop.</p>
<pre name="code" class="php" >
&lt;?php
query_posts(array('post__not_in' =&gt; $ids));
while (have_posts()) : the_post();
the_title();
the_content();
endwhile;
?&gt;
</pre>
<p>Source: <a href="http://www.smashingmagazine.com/2009/06/10/10-useful-wordpress-loop-hacks/" target="_blank" >10 Useful WordPress Loop Hacks(Smashing Magazine)</a></p>
<h4>18. <a href="http://buildinternet.com/2009/06/displaying-author-meta-information-in-wordpress-2-8/" target="_blank" >Displaying Author Meta Information in WordPress 2.8</a></h4>
<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/06/WordPress2.8AuthorMeta.jpg" alt="Display Author Info in WordPress" class="largepostimage" /><br />
WordPress 2.8 includes a new function <code>the_author_meta()</code> to display author information easily. This tutorial explains every aspect of the new function. Here&#8217;s the sample code to make an author info box like the image, you will need to apply your ow styles.</p>
<pre name="code" class="php" >
&lt;div id=&quot;authorbox&quot;&gt;
   &lt;?php if (function_exists('get_avatar')) { echo get_avatar(get_the_author_meta('user_email'), '80'); }?&gt;
   &lt;div&gt;
      &lt;h4&gt;About &lt;a href=&quot;&lt;?php the_author_meta('user_url'); ?&gt;&quot;&gt;&lt;?php the_author_meta('display_name'); ?&gt;&lt;/a&gt;&lt;/h4&gt;
      &lt;p&gt;&lt;?php the_author_meta('description'); ?&gt;&lt;/p&gt;
   &lt;/div&gt;
&lt;/div&gt;
</pre>
<h4>19. <a href="http://justintadlock.com/archives/2008/11/01/making-your-themes-comments-compatible-with-wordpress-27-and-earlier-versions" target="_blank" >Make Your Theme Comments Backward Compatible with version 2.7 and earlier</a></h4>
<p>If you design themes for WordPress 2.7 or later, then you might be using <em>wp_list_comments()</em> to show comments but since this function is not supported by earlier functions, you&#8217;ll have to use legacy methods to show comments. This tutorial shows you how to make your theme compatible by using different version of comments file depending on the WordPress version.</p>
<h4>20. <a href="http://www.johnkolbert.com/wordpress/show-your-latest-tweet-in-5-lines-of-code/" target="_blank" >Show Your Latest Tweet in Just 5 Lines of Code</a></h4>
<p>This piece of code is just awsome as it lets you show your latest tweet with no more than 5 lines of code using the twitter search feed. Add this code to <em>functions.php</em>.</p>
<pre name="code" class="php" >
function wp_echoTwitter($username){
     include_once(ABSPATH.WPINC.'/rss.php');
     $tweet = fetch_rss(&quot;http://search.twitter.com/search.atom?q=from:&quot; . $username . &quot;&amp;rpp=1&quot;);
     echo $tweet-&gt;items[0]['atom_content'];
}
</pre>
<p>To display latest tweet within your theme, use the below line of code, remember to replace username with your own.</p>
<pre name="code" class="php" >
&lt;?php wp_echoTwitter('webdevplus'); ?&gt;
</pre>
<h4>21. <a href="http://www.wprecipes.com/how-to-embed-css-in-your-posts-with-a-custom-field" target="_blank" >How To Embed CSS in your posts With Custom Field</a></h4>
<p>If you would like to style a particular post in a different style from the rest, then here&#8217;s nice custom field hack from WP-Recipes.<br />
Add the below code to your theme&#8217;s <em>header.php</em> file between &lt;head&gt; and &lt;/head&gt; tags.</p>
<pre name="code" class="php" >
&lt;?php if (is_single()) {
    $css = get_post_meta($post-&gt;ID, 'css', true);
    if (!empty($css)) { ?&gt;
        &lt;style type=&quot;text/css&quot;&gt;
        &lt;?php echo $css; ?&gt;
        &lt;style&gt;
    &lt;?php }
} ?&gt;
</pre>
<p>Now whenever you want a custom styled post, add a custom field named css to it with its value set to the styles you want to apply.</p>
<h4>22. <a href="http://www.wprecipes.com/creating-user-defined-rss-feeds-in-wordpress" target="_blank" >Create Custom User-Defined RSS Feeds</a></h4>
<p>If you are redirecting your feed to feedburner using feedsmith plugin, then it becomes nearly impossible to provide feeds for particular category, but this one is a really nice solution from WP-Recipes that involves creating a custom page template for your custom feed.</p>
<h4>23. <a href="http://wplover.com/how-to-launch-your-wordpress-theme/" target="_blank" >Guide To Launch Your WordPress Theme</a></h4>
<p>If you develop Free WordPress Themes for community, then you not only need to code and develop it but also, its your job to promote it to the wordpress community. This article from WP Lover guides about how to successfully promote your theme.</p>
<h3>Additional Resources</h3>
<h4>Theme Development Checklist</h4>
<p><img src="http://static.webdeveloperplus.com/uploads/2009/08/excellent-wp-resources/theme-development-checklist.jpg" class="largepostimage" width="600px" height="246px" alt="Theme development checklist" /><br />
With theme development checklist, you can keep track of important things to do during theme development and make sure you have completed everything required. Here are two theme development checklists.</p>
<ul>
<li><a href="http://codex.wordpress.org/Theme_Development_Checklist" target="_blank" >Theme Development Checklist From WordPress Docs</a></li>
<li>WordPress Theme Development Checklist From <a href="http://wptoy.com/resources/wordpress-theme-development-check-list-pdf-version/" target="_blank" >WPToy</a> (<a href="http://wptoy.com/download/1" >Download PDF</a>)</li>
</ul>
<h4>Theme Development Sample Content</h4>
<p>Sample content for wordpress helps you test your wordpress theme&#8217;s functionality easily and see how different types of content looks in it. To add sample content, simply login to WordPress Dashboard and go to <em>Tools > Import > WordPress</em>.</p>
<ul>
<li><a href="http://svn.automattic.com/wpcom-themes/test-data.2008-12-22.xml" >Theme Development Sample Content From WordPress Docs</a></li>
<li><a href="http://wpcandy.com/articles/easier-theme-development-with-the-sample-post-collection.html" target="_blank" >Sample Content For WordPress Theme Developers &#8211; WPCandy</a></li>
</ul>
<h4>WordPress Template Hierarchy Diagram</h4>
<p><img src="http://static.webdeveloperplus.com/uploads/2009/08/excellent-wp-resources/template-hierarchy.jpg" class="largepostimage" height="230px" width="600px" alt="Template hierarchy diagram" /><br />
WordPress template hierarchy diagram comes handy when you want to know which theme file is used when and which file will be used if a particular theme file is absent. Here&#8217;s a nice <a href="http://wpcandy.com/wp-content/uploads/2008/04/wp-diagram.jpg" target="_blank">template hierarchy diagram</a> from <a href="http://wpcandy.com/articles/tutorials/wordpress-template-hierarchy-diagram.html" target="_blank" >WPCandy</a> .</p>
<p>Share your favorite WordPress tutorials or resources in comments below so that this post becomes more useful.</p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/' rel='bookmark' title='How To Use Thumbnails Generated By WordPress In Your Theme'>How To Use Thumbnails Generated By WordPress In Your Theme</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/free-wordpress-theme-for-personal-blogs-youare/' rel='bookmark' title='Free WordPress Theme For Personal Blogs &#8211; YouAre'>Free WordPress Theme For Personal Blogs &#8211; YouAre</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/10-incredibly-useful-wordpress-2-8-tutorials/' rel='bookmark' title='10 Incredibly Useful WordPress 2.8 Tutorials'>10 Incredibly Useful WordPress 2.8 Tutorials</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/23-excellent-tutorials-for-wordpress-theme-developers/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>10 Incredibly Useful WordPress 2.8 Tutorials</title>
		<link>http://webdeveloperplus.com/wordpress/10-incredibly-useful-wordpress-2-8-tutorials/</link>
		<comments>http://webdeveloperplus.com/wordpress/10-incredibly-useful-wordpress-2-8-tutorials/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 06:52:14 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpree theme]]></category>
		<category><![CDATA[wordpress 2.8]]></category>
		<category><![CDATA[wordpress hacks]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/wordpress/10-incredibly-useful-wordpress-2-8-tutorials/</guid>
		<description><![CDATA[WordPress 2.8 was released yesterday and it has a long list of new features, fixes and enhancements. Here’s a round up of 10 incredibly useful tutorials to learn about how to use the new functionality and enhancements of WordPress 2.8]]></description>
			<content:encoded><![CDATA[<p><img src="http://webdeveloperplus.com/wp-content/uploads/2009/06/WordPress2.8Baker.jpg" alt="WordPress 2.8 Baker " title="WordPress 2.8 Baker " width="503" height="246" class="alignnone size-full wp-image-79" /></p>
<p>WordPress 2.8 was released yesterday and it has a long <a href="http://codex.wordpress.org/Version_2.8" target="_blank">list</a> of new features, fixes and enhancements. Here’s a round up of 10 incredibly useful tutorials to learn about how to use the new functionality and enhancements of WordPress 2.8</p>
<h3>1. <a title="Build a WordPress 2.8 Widget with New Widget API" href="http://wpengineer.com/wordpress-built-a-widget/" target="_blank">Build a WordPress 2.8 Widget with New Widget API &#8211; WPEngineer</a></h3>
<p>WPEngineer Michael Preuss walks you through the new simpler Widget API in WordPress 2.8 to create a simple widget. Very simple and easy to understand tutorial.</p>
<h3>2. <a title="The Complete Guide To Creating Widgets in WordPress2.8" href="http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28" target="_blank">The Complete Guide To Creating Widgets in WordPress2.8 – Justin Tadlock</a></h3>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Complete Guide To WordPress 2.8 Widgets" border="0" alt="Complete Guide To WordPress 2.8 Widgets" src="http://webdeveloperplus.com/wp-content/uploads/2009/06/CompleteGuideToWordPress2.8Widgets.jpg" width="579" height="163" /> </p>
<p>This is another great resource to learn how to build a widget using the new Widget API by Justin Tadlock. </p>
<h3>3. <a href="http://jessealtman.com/2009/06/08/tutorial-wordpress-28-widget-api/" target="_blank">Tutorial on WordPress 2.8 Widget API – Jesse Altman</a></h3>
<p>Another easy to understand hello world tutorial on working with new WordPress widget API.</p>
<h3>4. <a title="Custom Taxonomies in WordPress 2.8 – Justin Tadlock" href="http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28" target="_blank">Custom Taxonomies in WordPress 2.8 – Justin Tadlock</a></h3>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WordPress 2.8 Taxonomies" border="0" alt="WordPress 2.8 Taxonomies" src="http://webdeveloperplus.com/wp-content/uploads/2009/06/WordPress2.8Taxonomies.jpg" width="599" height="234" /> </p>
<p>If you find categories and tags too restricting for the stuff you write, Justin Tadlock explains how to define your own taxonomies in WordPress 2.8 to label your posts in the way you want.</p>
<h3>5. <a title="WordPress 2.8 and body_class() function – Nathan Rice" href="http://www.nathanrice.net/blog/wordpress-2-8-and-the-body_class-function/" target="_blank">WordPress 2.8 and <em>body_class()</em> function – Nathan Rice</a></h3>
<p>WordPress 2.8 supports location-specific classes for body tag with which you can control the looks of almost everything with just CSS. </p>
<h3>6. <a title="Load JavaScripts in Footer of Your Theme – Lester Chan" href="http://lesterchan.net/wordpress/2009/01/26/loading-javascript-in-footer-in-wordpress-28/" target="_blank">Load JavaScript Files in Footer of Your Theme – Lester Chan</a></h3>
<p>Now you can make your WordPress blog faster by loading JavaScript files in the footer. Lester Chan explains how to do that in WordPress 2.8</p>
<h3>7. <a title="Displaying Author Meta Information in WordPress 2.8 - Zach Dunn" href="http://buildinternet.com/2009/06/displaying-author-meta-information-in-wordpress-2-8/" target="_blank">Displaying Author Meta Information in WordPress 2.8 &#8211; Zach Dunn</a></h3>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WordPress2.8 Author Meta" border="0" alt="WordPress2.8 Author Meta" src="http://webdeveloperplus.com/wp-content/uploads/2009/06/WordPress2.8AuthorMeta.jpg" width="585" height="161" /> </p>
<p>WordPress 2.8 include two new functions <em>the_author_meta()</em> and <em>get_the_author_meta()</em> to display information about authors. Zach Dunn explains how to use these new functions in your WordPress theme.</p>
<h3>8. <a title="the_author_meta() in WordPress Codex" href="http://codex.wordpress.org/Template_Tags/the_author_meta" target="_blank"><em>the_author_meta()</em> in WordPress Codex</a></h3>
<p>The WordPress codex explains the new author meta information methods, its parameters and examples.</p>
<h3>9. <a href="http://planetozh.com/blog/2009/05/handling-plugins-options-in-wordpress-28-with-register_setting/" target="_blank">Handling Plugin Options in WordPress 2.8 – PlanetOzh</a></h3>
<p>WordPress 2.8 includes interesting <em>register_setting()</em> function that lets plugin authors leave the dirty stuff to WordPress and concentrate on the functionality of plugin.</p>
<h3>10 <a title="WordPress Proxy Support" href="http://wpengineer.com/wordpress-proxysupport/" target="_blank">WordPress Proxy Support – WP Engineer</a></h3>
<p>If you are using WordPress on your local network which is behind a proxy, then now you can easily fetch content from other websites or RSS feeds as WordPress 2.8 requires just a little edition to <em>wp-config.php</em> to work behind a proxy.</p>
<p>If you know of some other nice tutorials on WordPress 2.8, feel free to share them with us.</p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/23-excellent-tutorials-for-wordpress-theme-developers/' rel='bookmark' title='23+ Excellent Tutorials For WordPress Theme Developers'>23+ Excellent Tutorials For WordPress Theme Developers</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/12-lesser-known-but-useful-wordpress-hacks/' rel='bookmark' title='12 Lesser Known But Useful WordPress Hacks'>12 Lesser Known But Useful WordPress Hacks</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/' rel='bookmark' title='How To Use Thumbnails Generated By WordPress In Your Theme'>How To Use Thumbnails Generated By WordPress In Your Theme</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/10-incredibly-useful-wordpress-2-8-tutorials/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How To Use Thumbnails Generated By WordPress In Your Theme</title>
		<link>http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/</link>
		<comments>http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 13:34:57 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[Popular]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[image thumbnails]]></category>
		<category><![CDATA[wordpress hacks]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/</guid>
		<description><![CDATA[Wordpress has inbuilt functionality of generating thumbnails of images attached to a post. In this post, i'll show you how to use them in your WordPress Theme without requiring any third party plugins or scripts and also without even using any custom fields.]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; border-top: 0px; border-right: 0px" border="0" alt="Thumbnail Image" align="left" src="http://webdeveloperplus.com/wp-content/uploads/2009/06/thumbnail-image.jpg" width="244" height="172" /> Many WordPress Themes display post excerpts on blog homepage with a little thumbnail image of one of the images used within a post, but most of the WordPress themes I have seen, use some kind of external image resizing script like <a href="http://webdeveloperplus.com/tag/phpthumb/">phpThumb</a> or tinyThumb or they use some custom field in the post to show thumbnail image.</p>
<p>But WordPress has inbuilt functionality of generating thumbnails of the images you add to your post. This functionality is enabled by default unless you have explicitly set it from Media Settings in WordPress Settings panel. </p>
<p><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="WordPress Thumbnails" src="http://webdeveloperplus.com/wp-content/uploads/2009/06/wordpress-thumbnails.jpg" width="600" height="314" /> </p>
<p>Today, I&#8217;m going to show you how to use thumbnails generated by WordPress in your theme without requiring any third party script, plugin or custom field.</p>
<p>1. First of all set the thumbnail size to what you want in the <em>Media Settings</em> of WordPress.</p>
<p>2. Now open up <em>index.php</em> of your WordPress theme and inside the WordPress loop, add the following lines of code to get the path of thumbnail image of the first image in the post.</p>
<pre name="code" class="php">&lt;?php
//Get images attached to the post
$args = array(
	'post_type' => 'attachment',
	'post_mime_type' => 'image',
	'numberposts' => -1,
        'order' => 'ASC',
	'post_status' => null,
	'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
	foreach ($attachments as $attachment) {
		$img = wp_get_attachment_thumb_url( $attachment->ID );
                break;
        }
//Display image
}
?&gt;</pre>
<p><em><strong>Code Explanation:</strong></em> Firstly we fetch the images attached to the post in the order they were added to the post. And if images are there we fetch the path to the thumbnail image of the first image in the post using <em>wp_get_attachment_thumb_url</em> function.</p>
<p>Now you have path of the image in <em>$img</em> which you can use to display the post thumbnail using <em>img</em> tag.</p>
<p>If you have visited the homepage of <a href="http://webdeveloperplus.com">Web Developer Plus</a>, I am using this technique to display post thumbnails with post excerpts.</p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/23-excellent-tutorials-for-wordpress-theme-developers/' rel='bookmark' title='23+ Excellent Tutorials For WordPress Theme Developers'>23+ Excellent Tutorials For WordPress Theme Developers</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/free-wordpress-theme-for-personal-blogs-youare/' rel='bookmark' title='Free WordPress Theme For Personal Blogs &#8211; YouAre'>Free WordPress Theme For Personal Blogs &#8211; YouAre</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/12-lesser-known-but-useful-wordpress-hacks/' rel='bookmark' title='12 Lesser Known But Useful WordPress Hacks'>12 Lesser Known But Useful WordPress Hacks</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/how-to-use-thumbnails-generated-by-wordpress-in-your-theme/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Create Post Only For Your RSS Subscribers in WordPress</title>
		<link>http://webdeveloperplus.com/wordpress/create-post-only-for-your-rss-subscribers-in-wordpress/</link>
		<comments>http://webdeveloperplus.com/wordpress/create-post-only-for-your-rss-subscribers-in-wordpress/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 10:54:13 +0000</pubDate>
		<dc:creator>Satbir</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[rss feed]]></category>
		<category><![CDATA[wordpress hacks]]></category>

		<guid isPermaLink="false">http://webdeveloperplus.com/wordpress/create-post-only-for-your-rss-subscribers-in-wordpress/</guid>
		<description><![CDATA[To benefit their regular readers, blog owners some times need to create posts only for those who subscribe to their RSS Feed. The benefit might be some promotional scheme, freebies or discount announcement that you only want to provide to your regular RSS subscribers. Here’s how to do it if you have a WordPress powered [...]]]></description>
			<content:encoded><![CDATA[<p>To benefit their regular readers, blog owners some times need to create posts only for those who subscribe to their RSS Feed. The benefit might be some promotional scheme, freebies or discount announcement that you only want to provide to your regular RSS subscribers. Here’s how to do it if you have a WordPress powered blog.</p>
<p>1. First of all, you need to define a category specifically for posts that are to be displayed only in RSS Feed. Let’s say you define a new category ‘RSS Only’ to handle RSS only posts.</p>
<p>After defining the category note down its category ID. To know category ID of the category, open the edit category page for that category and in the address bar of the page, you can find category ID.</p>
<p>2. Now open your theme’s <em>functions.php</em> file in an editor or use the theme editor in WordPress admin. If your theme does not have <em>functions.php</em> file, create one. Add the following code to your <em>functions.php</em> file.</p>
<pre name="code" class="php">&lt;?php
function excludeCategory($query)
{
	if($query-&gt;is_home | $query-&gt;is_archive )
	$query-&gt;set('cat','-3');
	return $query;
}
add_filter('pre_get_posts', 'excludeCategory');
?&gt;</pre>
<p><em>pre_get_posts</em> is a <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference" target="_blank">WordPress filter</a> which is run before fetching posts from the database. What we’ve done here is to exclude the category defined above from all pages except RSS Feed. <strong>Remember to use the negative sign before category ID</strong> to exclude that category.</p>
<p>Now whenever you add a post to this category, it won’t show up on your blog’s homepage, category page, tag page or any other archive page but will be visible in your RSS Feed exclusively for your RSS subscribers.</p>
<p>The post page would however be there as it is for every other post but the post won’t show up anywhere else on your blog.</p>
<p>3. And lastly, if you are using <em>wp_list_categories</em> function to display categories list somewhere in your theme, you need to pass a parameter to <em>wp_list_categories</em> to exclude category meant only for RSS feeds from displaying.</p>
<pre name="code" class="php">wp_list_categories('exclude=3');</pre>
<p>And if wp_list_categories already has parameters then append the exclude parameter using &amp; sign.</p>
<pre name="code" class="php">wp_list_categories('show_count=1&amp;exclude=3');</pre>
<p>Now you can create special posts meant only for your RSS readers. If you know or use some other method of creating RSS only posts, feel free to share them in comments below.</p>
<p>Related posts:<ol>
<li><a href='http://webdeveloperplus.com/wordpress/12-lesser-known-but-useful-wordpress-hacks/' rel='bookmark' title='12 Lesser Known But Useful WordPress Hacks'>12 Lesser Known But Useful WordPress Hacks</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/23-excellent-tutorials-for-wordpress-theme-developers/' rel='bookmark' title='23+ Excellent Tutorials For WordPress Theme Developers'>23+ Excellent Tutorials For WordPress Theme Developers</a></li>
<li><a href='http://webdeveloperplus.com/wordpress/how-to-ajaxify-wordpress-comment-posting/' rel='bookmark' title='How To: AJAXify WordPress Comment Posting'>How To: AJAXify WordPress Comment Posting</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://webdeveloperplus.com/wordpress/create-post-only-for-your-rss-subscribers-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

