<?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>Blogsessive &#187; coding</title>
	<atom:link href="http://blogsessive.com/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogsessive.com</link>
	<description>Visit Blogsessive for daily WordPress blogging tips.</description>
	<lastBuildDate>Sun, 22 Apr 2012 07:56:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress How To: Latest Posts by Category Archive</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/</link>
		<comments>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 02:47:30 +0000</pubDate>
		<dc:creator>Alex, Blogsessive</dc:creator>
				<category><![CDATA[Blog Design]]></category>
		<category><![CDATA[Blogging Tools]]></category>
		<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blogsessive.com/?p=1047</guid>
		<description><![CDATA[Blogsessive recommends WP WebHost for quality WordPress blog hosting!One technique that is most common with WordPress magazine or news style themes is the display of an archive of the latest posts by category, as simple titles or with post excerpts. This is useful for the previously mentioned theme styles, but not only. It can be [...]]]></description>
			<content:encoded><![CDATA[<p>With the StudioPress WordPress themes you can really <a href="http://blogsessive.com/go-studiopress/" title="Take Your Blog to a Higher Level" target="ejejcsingle"><strong>take your blog to a higher level</strong></a>!<p><a title="WordPress - Latest posts by category" href="http://blogsessive.com/wp-content/uploads/2009/02/latest-posts-by-category-archive.gif" target="_blank"><img style="float: right; margin-left: 20px; border: 1px solid #ebe6dc; padding: 5px;" title="Latest posts by category archive" src="http://blogsessive.com/wp-content/uploads/2009/02/latest-posts-by-category-archive-150x150.gif" alt="WordPress - Latest posts by category" width="150" height="150" /></a>One technique that is most common with WordPress magazine or news style themes is the display of an archive of the latest posts by category, as simple titles or with post excerpts. This is useful for the previously mentioned theme styles, but not only. It can be used to set up custom blog homepages, 404 pages, landing pages or even a special archive page.</p>
<p>This tutorial will help you build a &#8216;<strong>Latest Posts by Category Archive</strong>&#8216; in a very easy way. The widths in the CSS styling presented below have been calculated based on the default WordPress theme, assuming that is the most common theme available to anyone.</p>
<p>If you are looking for a plugin to generate such an archive, please check out: <a href="http://blogsessive.com/blogging-tools/wp-plugin-latest-posts-by-category-archive/" target="_blank" title="WordPress Plugin: Latest Posts by Category Archive"><strong>WP Plugin: Latest Posts by Category Archive</strong></a>.</p>
<h3>Setting up the page template</h3>
<p>Open up you favorite code editor and create a blank document. Save the document as &#8216;category-archive.php&#8217; (or any other name you&#8217;d prefer) in the default WordPress theme directory (wp-content/themes/default).</p>
<p>The first step is to asign our new template a name and a page-like structure, so based on the default theme&#8217;s page template, the code you should paste in your new document is:</p>
<pre class="brush: php">
&lt;?php
/*
Template Name: Category Archive
*/
?&gt;

&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot;&gt;

	&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
	&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
	&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;
		&lt;div class=&quot;entry&quot;&gt;
			&lt;?php the_content(&#039;&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &amp;raquo;&lt;/p&gt;&#039;); ?&gt;

			&lt;?php wp_link_pages(array(&#039;before&#039; =&gt; &#039;&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; &#039;, &#039;after&#039; =&gt; &#039;&lt;/p&gt;&#039;, &#039;next_or_number&#039; =&gt; &#039;number&#039;)); ?&gt;

		&lt;/div&gt;
	&lt;/div&gt;
	&lt;?php endwhile; endif; ?&gt;

	&lt;!-- Category Archive Start --&gt;
	&lt;!-- Category Archive End --&gt;

&lt;/div&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>The template above will make sure to display the page name you set up, and also, any additional content you might want to add <em>before the archive</em>, from you WordPress page editor. We will be adding our &#8216;latest posts by category&#8217; code between the &#8216;Category Archive Start&#8217; and &#8216;Category Archive End&#8217; comments.<span id="more-1047"></span></p>
<h3>Adding the archive&#8217;s PHP code</h3>
<p>Simply put, the code below will cycle through the first-level categories of your blog (parent categories), check for the ones that are not empty and if this condition is met, return an unordered list of the latest 5 post from each category. Empty categories will not be displayed.</p>
<pre class="brush: php">
&lt;?php
/*
Template Name: Category Archive
*/
?&gt;

&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot;&gt;

	&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
	&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
	&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;
		&lt;div class=&quot;entry&quot;&gt;
			&lt;?php the_content(&#039;&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &amp;raquo;&lt;/p&gt;&#039;); ?&gt;

			&lt;?php wp_link_pages(array(&#039;before&#039; =&gt; &#039;&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; &#039;, &#039;after&#039; =&gt; &#039;&lt;/p&gt;&#039;, &#039;next_or_number&#039; =&gt; &#039;number&#039;)); ?&gt;

		&lt;/div&gt;
	&lt;/div&gt;
	&lt;?php endwhile; endif; ?&gt;

	&lt;!-- Category Archive Start --&gt;
	&lt;ul class=&quot;catArchive&quot;&gt;
	&lt;?php
	$catQuery = $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON ( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#039;category&#039; AND wtaxonomy.parent = 0 AND wtaxonomy.count &gt; 0&quot;);

	$catCounter = 0;

	foreach ($catQuery as $category) {

		$catCounter++;

		$catStyle = &#039;&#039;;
		if (is_int($catCounter / 2)) $catStyle = &#039; class=&quot;catAlt&quot;&#039;;

		$catLink = get_category_link($category-&gt;term_id);

		echo &#039;&lt;li&#039;.$catStyle.&#039;&gt;&lt;h3&gt;&lt;a href=&quot;&#039;.$catLink.&#039;&quot; title=&quot;&#039;.$category-&gt;name.&#039;&quot;&gt;&#039;.$category-&gt;name.&#039;&lt;/a&gt;&lt;/h3&gt;&#039;;
			echo &#039;&lt;ul&gt;&#039;;

			query_posts(&#039;cat=&#039;.$category-&gt;term_id.&#039;&amp;showposts=5&#039;);?&gt;

			&lt;?php while (have_posts()) : the_post(); ?&gt;
				&lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;?php endwhile; ?&gt;

				&lt;li&gt;&lt;a href=&quot;&lt;?php echo $catLink; ?&gt;&quot; title=&quot;&lt;?php echo $category-&gt;name; ?&gt;&quot;&gt;More &lt;strong&gt;&lt;?php echo $category-&gt;name; ?&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;?php }	?&gt;
	&lt;/ul&gt;
	&lt;!-- Category Archive End --&gt;

&lt;/div&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>You should now save your file, because <strong>we&#8217;re done editing it</strong>. As you can see, the archive code has been added between the &#8216;Start&#8217; and &#8216;End&#8217; comments. Now let&#8217;s go through the code and dissect it.</p>
<h3>The PHP code explained</h3>
<p>The first thing we do is to set up a database query to cycle through the non-empty parent categories:</p>
<pre class="brush: php">
$catQuery = $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON ( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#039;category&#039; AND wtaxonomy.parent = 0 AND wtaxonomy.count &gt; 0&quot;);
</pre>
<p>You can further tweak this query to exclude categories or specify categories to be listed based on their ID, with the use of the MySQL comparison functions NOT IN or IN.</p>
<p>Let&#8217;s say that you&#8217;d like the archive to exclude the categories with IDs 2, 5 and 6. Your query would become:</p>
<pre class="brush: php">
$catQuery = $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON ( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#039;category&#039; AND wtaxonomy.parent = 0 AND wtaxonomy.count &gt; 0 AND wterms.term_id NOT IN (2,5,6)&quot;);
</pre>
<p>Similarly, if you want to display only the categories with IDs 2,5 and 6, you&#8217;d have:</p>
<pre class="brush: php">
$catQuery = $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON ( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#039;category&#039; AND wtaxonomy.parent = 0 AND wtaxonomy.count &gt; 0 AND wterms.term_id IN (2,5,6)&quot;);
</pre>
<p>For further help with comparison operators and functions, you can check out the <a href="http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html" target="_blank" title="MySQL Comparison Operators and Functions">MySQL manual</a>.</p>
<p>Next, we set up a category counter which will be incremented each time a category will be displayed. Based on this counter, the code adds a &#8216;<strong>catAlt</strong>&#8216; class that you can use to style differently consecutive categories. In our case, we&#8217;ll use it to shift the categories into two columns. This is were the alternate classes are assigned:</p>
<pre class="brush: php">
$catCounter++;

$catStyle = &#039;&#039;;
if (is_int($catCounter / 2)) $catStyle = &#039; class=&quot;catAlt&quot;&#039;;
</pre>
<p>The category list is built by the use of <strong>foreach</strong> and it helps retrieve vital information about the categories, such as name and permalink:</p>
<pre class="brush: php">
foreach ($catQuery as $category) {
	/* Code used to retrieve and display the latest posts */
}
</pre>
<p>After we display the category title and link through this line of code</p>
<pre class="brush: php">
echo &#039;&lt;li&#039;.$catStyle.&#039;&gt;&lt;h3&gt;&lt;a href=&quot;&#039;.get_category_link($category-&gt;term_id).&#039;&quot; title=&quot;&#039;.$category-&gt;name.&#039;&quot;&gt;&#039;.$category-&gt;name.&#039;&lt;/a&gt;&lt;/h3&gt;&#039;;
</pre>
<p>we continue by using a custom query to retrieve the latest 5 posts from the current category in the cycle, followed by a link to the complete category archive:</p>
<pre class="brush: php">
query_posts(&#039;cat=&#039;.$category-&gt;term_id.&#039;&amp;showposts=5&#039;);?&gt;

&lt;?php while (have_posts()) : the_post(); ?&gt;
	&lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;?php endwhile; ?&gt;
	&lt;li&gt;&lt;a href=&quot;&lt;?php echo $catLink; ?&gt;&quot; title=&quot;&lt;?php echo $category-&gt;name; ?&gt;&quot;&gt;More &lt;strong&gt;&lt;?php echo $category-&gt;name; ?&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
</pre>
<p>And that&#8217;s about everything in terms of coding! Now, onto the CSS styling.</p>
<h3>Styling the archive</h3>
<p>Find the <strong>style.css</strong> file in your default theme&#8217;s directory, open it and scroll down to the end of the file. Now copy the code below and paste it in your file.</p>
<pre class="brush: css">
/* Latest posts by category styles */

.catArchive {
	width: 450px;
	overflow: hidden;
	margin: 20px 0 0 0;
	padding: 0;
	list-style-type: none;
}

.catArchive h3 {
	font: normal bold 18px sans-serif;
	border-bottom: 1px solid #666;
	margin: 0;
	padding: 0 0 3px 0;
	display: block;
}

.catArchive li {
	display: block;
	float: left;
	width: 210px;
	margin: 0 30px 30px 0;
}

.catArchive ul {
	margin: 0;
	padding: 0;
}

.catArchive li li {
	border-bottom: 1px solid #ddd;
	margin: 0;
	padding: 4px 0;
}

.catAlt {
	margin-right: 0 !important;
}
</pre>
<p>Now, save the file. We&#8217;re done!</p>
<p><strong>Note:</strong> Keep in mind that column sizes have been calculated based on the available space (450 pixels) in the default theme&#8217;s content area. So, our columns should each be 210 pixels wide, with a 30 pixels spacing between them.</p>
<p>Since the column shifting is done with the help of <strong>float</strong>, I&#8217;ve set the overflow to hidden to stretch the list full height. This can only work with a fixed given container width, which in our case is 450px set on <strong>.catArchive</strong>.</p>
<p>If your new to &#8220;floating&#8221;, Sarah has posted a fairly easy to understand article about <a href="http://www.bloggingtips.com/2009/02/12/understanding-the-float-property/" target="_blank" title="The CSS float property">the float property</a> on BloggingTips.com.</p>
<p>You can download an archive containing both source files: <a href="http://blogsessive.com/wp-content/plugins/download-monitor/download.php?id=4" title="Download Latest Posts by Category source files"><strong>Download</strong></a>.</p>
<hr /><h3>Free PDF eBook: Corporate Blogging Guide by Blogsessive</h3>As a subscribe reader of Blogsessive, this is my gift to you: a guide to corporate blogging (but not only) that will help you in your blogging adventures! <a href="http://blogsessive.com/wp-content/plugins/download-monitor/download.php?id=8" target="_blank">Download now, for FREE!</a><br /><br /><hr/><div style="background: #eeeeee;">Advertise on Blogsessive! <a href="http://buysellads.com/buy/detail/310/" title="Advertise on Blogsessive">125x125 banners</a> for <strong>$50 per month</strong>!</div>&copy;2008-2010 Copyright by <a href="http://blogsessive.com" title="Blogging tips">Blogsessive - Blogging Tips</a>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please <a href="http://blogsessive.com/contact" title="Contact Blogsessive">contact us</a>, so that we can take legal action immediately.<img src="http://blogsessive.com/?ak_action=api_record_view&id=1047&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Post Excerpts and the More Tag in WordPress</title>
		<link>http://blogsessive.com/blogging-tools/wordpress-post-excerpts-more-tag/</link>
		<comments>http://blogsessive.com/blogging-tools/wordpress-post-excerpts-more-tag/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 20:38:27 +0000</pubDate>
		<dc:creator>Alex, Blogsessive</dc:creator>
				<category><![CDATA[Blogging Tools]]></category>
		<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[excerpts]]></category>
		<category><![CDATA[more]]></category>
		<category><![CDATA[template tags]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blogsessive.com/?p=418</guid>
		<description><![CDATA[Blogsessive recommends WP WebHost for quality WordPress blog hosting!Not only once, it has been said that displaying full posts on your blog home page, category pages or archive pages increases the chance of being penalized for duplicate content. In WordPress, using post excerpts has proven to be a good alternative, but one that has its [...]]]></description>
			<content:encoded><![CDATA[<p>Do you need <a href="http://blogsessive.com/go-graphicriver/" title="Quality Graphic Design Resources" target="_blank"><strong>quality design resources</strong></a>? Graphic River has them. Tons! And cheap...</p><p>Not only once, it has been said that displaying full posts on your blog home page, category pages or archive pages increases the chance of being penalized for duplicate content.</p>
<p>In WordPress, using <strong>post excerpts</strong> has proven to be a good alternative, but one that has its downsides:</p>
<ul>
<li>You lose control over text formatting;</li>
<li>Images won&#8217;t be displayed;</li>
<li>If you don&#8217;t take time to write them yourself, WordPress might not select the most appropriate fragments;</li>
<li>Readers might not be convinced to further click, if the excerpt is not attractive enough.</li>
</ul>
<h3>Better Post Excerpts</h3>
<p>If you&#8217;re concerned about your writing style, you&#8217;ll most definitely take care about how you structure your posts, where you insert images and how you write the introductory paragraph.</p>
<p>With these in mind, you basically got yourself a very good post excerpt, one that you should not leave to WordPress to decide when and where to cut.</p>
<h4>The &#8216;More&#8217; Tag</h4>
<p>This is the most valid alternative to displaying post excerpts, if <strong>the_excerpt() </strong>template tag does not fit your needs.</p>
<p><strong>More</strong> is what the WordPress developers call a <em>quicktag</em>, designed to cut-off large posts into two fragments: one that will be displayed as an excerpt and one that users will continue to read from after clicking the &#8220;read more&#8221; link. It serves as a marker inside the post so that users who come from the excerpt link, will start reading the content from that point on, and not from the beginning, again.<span id="more-418"></span></p>
<p>What this quicktag actually represents is a HTML comment that WordPress translates a the cut-off point. To use it while editing your posts in HTML view, you simply need to add this where you want the post cut:</p>
<pre>Your introductory paragraph should be placed before using the 'more' quicktag.
That way it will act as a post excerpt.
&lt;!--more--&gt;</pre>
<p>Using it like in the above example will return a post excerpt similar to this:</p>
<blockquote><p>Your introductory paragraph should be placed before using the &#8216;more&#8217; quicktag.<br />
That way it will act as a post excerpt. <a href="#" rel="nofollow">more&#8230;</a></p></blockquote>
<h3>Customizing the &#8216;more&#8217; link</h3>
<p>The default text (<em>more&#8230;</em>) is not very attractive, right? I mean, you must really be interested in the rest of the story to click it.</p>
<p>But fear not, there are many ways in which you could customize the link, applying a global or single post effect. Described below are two methods you could use.</p>
<h4 style="margin-top: 25px">Method One: Customizing the_content() template tag</h4>
<p class="articlefeat">
<strong>Effects:</strong> Global<br />
<strong>Requirements:</strong> Minor coding knowledge</p>
<p>As per default, posts excerpts are displayed by using <em>the_excerpt()</em>, while full posts are displayed through the use of <em>the_content() tag</em>.</p>
<p>If you take a look at the code of your theme&#8217;s <em>index.php</em> file, and of course if it uses full posts, you&#8217;ll notice a line of code similar to this one:</p>
<pre>&lt;?php the_content(); ?&gt;</pre>
<p>The easiest way to customize it and obtain a global effect would be by adding a parameter containing your own &#8216;read more&#8217; text, as shown in the example below:</p>
<pre>&lt;?php the_content(' Continue reading this post!'); ?&gt;</pre>
<p>The end result will look similar to this:</p>
<blockquote><p>Your introductory paragraph should be placed before using the &#8216;more&#8217; quicktag.<br />
That way it will act as a post excerpt. <a href="#" rel="nofollow"> Continue reading this post!</a></p></blockquote>
<p>To further more customize the link, you can even use HTML code and add CSS classes to it:</p>
<pre>&lt;?php the_content(' <span class="moreLink">Continue reading this post!</span>'); ?&gt;</pre>
<p>or use WordPress&#8217; <em>get_the_title()</em> template tag to add the post name inside the link, like this:</p>
<pre>&lt;?php the_content(' Continue reading '.get_the_title()); ?&gt;</pre>
<p>Assuming the example of my own post title, this will result in something similar the this:</p>
<blockquote><p>Your introductory paragraph should be placed before using the &#8216;more&#8217; quicktag.</p>
<p>That way it will act as a post excerpt. <a href="#" rel="nofollow"> Continue reading Post Excerpts and the More Tag in WordPress</a></p></blockquote>
<p>Of course, you could always use a combination of HTML tags and WordPress template tags to further customize the link, as long as you keep in mind that the effect will be global (will apply to all posts using the <em>more</em> quicktag).</p>
<h4 style="margin-top: 25px">Method Two: Customizing the &lt;!&#45;&#45;more&#45;&#45;&gt; quicktag</h4>
<p class="articlefeat">
<strong>Effects:</strong> Single post<br />
<strong>Requirements:</strong> Nothing a 5 year old won&#8217;t manage</p>
<p>Assuming you have adjusted the link to your needs by using the above described global-method and on some posts you need to tweak the link more, the best way to customize the display text is my adding it to the &lt;!&#45;&#45;more&#45;&#45;&gt; quicktag, as shown below, in your post HTML view:</p>
<pre>&lt;!--more This is my custom more text--&gt;</pre>
<p>This will result in:</p>
<blockquote><p>Your introductory paragraph should be placed before using the &#8216;more&#8217; quicktag.<br />
That way it will act as a post excerpt. <a href="#" rel="nofollow"> This is my custom more text</a></p></blockquote>
<p><strong>Note:</strong> The results of this method override the defaults or the effects of the first method and only affect the text, and not the formatting.</p>
<h3>That&#8217;s it!</h3>
<p>Easy as one, two, three, right? Happy customizing! And in case you need more information, here are a few links from the WordPress Codex:</p>
<ul>
<li><a href="http://codex.wordpress.org/Customizing_the_Read_More" target="_blank" rel="external">Customizing the Read More</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/the_content" target="_blank" rel="external">Template Tags: the_content()</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank" rel="external">Template Tags: the_excerpt()</a></li>
</ul>
<hr /><h3>Free PDF eBook: Corporate Blogging Guide by Blogsessive</h3>As a subscribe reader of Blogsessive, this is my gift to you: a guide to corporate blogging (but not only) that will help you in your blogging adventures! <a href="http://blogsessive.com/wp-content/plugins/download-monitor/download.php?id=8" target="_blank">Download now, for FREE!</a><br /><br /><hr/><div style="background: #eeeeee;">Advertise on Blogsessive! <a href="http://buysellads.com/buy/detail/310/" title="Advertise on Blogsessive">125x125 banners</a> for <strong>$50 per month</strong>!</div>&copy;2008-2010 Copyright by <a href="http://blogsessive.com" title="Blogging tips">Blogsessive - Blogging Tips</a>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please <a href="http://blogsessive.com/contact" title="Contact Blogsessive">contact us</a>, so that we can take legal action immediately.<img src="http://blogsessive.com/?ak_action=api_record_view&id=418&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blogsessive.com/blogging-tools/wordpress-post-excerpts-more-tag/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>WordPress Template Tags: wp_get_archives()</title>
		<link>http://blogsessive.com/blogging-tools/wordpress-template-tags-wp_get_archives/</link>
		<comments>http://blogsessive.com/blogging-tools/wordpress-template-tags-wp_get_archives/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 16:04:04 +0000</pubDate>
		<dc:creator>Alex, Blogsessive</dc:creator>
				<category><![CDATA[Blogging Tools]]></category>
		<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[template tags]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_get_archives()]]></category>

		<guid isPermaLink="false">http://blogsessive.com/blogging-tools/wordpress-template-tags-wp_get_archives/</guid>
		<description><![CDATA[Do you need quality design resources? Graphic River has them. Tons! And cheap...Welcome to our new series&#8217; first post! The &#8220;WordPress Template Tags&#8221; series is intended to bring into spotlight some of WordPress&#8217; less common, but very useful template tags. While the contents can&#8217;t be considered a revelation to advanced WP users and developers, it [...]]]></description>
			<content:encoded><![CDATA[<p>Have you read "<a href="http://blogsessive.com/go-wprockstar/" title="How To Be a Rockstar WordPress Designer" target="ejejcsingle"><strong>How To Be a Rockstar WordPress Designer</strong></a>" yet?</p><p>Welcome to our new series&#8217; first post! The &#8220;WordPress Template Tags&#8221; series is intended to bring into spotlight some of WordPress&#8217; less common, but very useful template tags. While the contents can&#8217;t be considered a revelation to advanced WP users and developers, it can be of big help to those who take their first steps in the amazing world of online publishing using this famous blogging platform.</p>
<p>But enough chit chat! Here&#8217;s our first recommendation:</p>
<h3>wp_get_archives()</h3>
<p>Have you ever thought of how to display a list of your most recent posts? Or a list of all posts published in the last 10 days? Or 6 months? Or 2 years?<span id="more-27"></span><br />
If so, after searching for a solution, you came across a plugin to help you, or used the WordPress&#8217; standard &#8220;Recent Posts&#8221; widget.</p>
<p>For such a small need, you had to install one more thing, when it could have solved with one tiny line of code using the wp_get_archives() template tag.</p>
<p>What makes this tag so useful is the possibility to customize the result based on a few factors like: type, format, limit, code to be added before &amp; after or post count. Since by default this template tag returns results inside of &lt;li&gt;&lt;/li&gt; elements, remember to always enclose it in &lt;ul&gt;&lt;/ul&gt;, like shown below:</p>
<h3>Usage &amp; Examples:</h3>
<p>1. Display an archive of the last 6 months:</p>
<pre>&lt;ul&gt;&lt;?php wp_get_archives('type=monthly&amp;limit=6'); ?&gt;&lt;/ul&gt;</pre>
<p>2. Display the latest 10 posts:</p>
<pre>&lt;ul&gt;&lt;?php wp_get_archives('type=postbypost&amp;limit=10'); ?&gt;&lt;/ul&gt;</pre>
<p>Also, the display mode can be customized so that instead of showing a &lt;ul&gt; / &lt;li&gt; list, the archives could be displayed in a dropdown form element.</p>
<p><strong>More reference:</strong> <a href="http://codex.wordpress.org/Template_Tags/wp_get_archives" title="WordPress Codex">WordPress Codex on wp_get_archives()</a></p>
<hr /><h3>Free PDF eBook: Corporate Blogging Guide by Blogsessive</h3>As a subscribe reader of Blogsessive, this is my gift to you: a guide to corporate blogging (but not only) that will help you in your blogging adventures! <a href="http://blogsessive.com/wp-content/plugins/download-monitor/download.php?id=8" target="_blank">Download now, for FREE!</a><br /><br /><hr/><div style="background: #eeeeee;">Advertise on Blogsessive! <a href="http://buysellads.com/buy/detail/310/" title="Advertise on Blogsessive">125x125 banners</a> for <strong>$50 per month</strong>!</div>&copy;2008-2010 Copyright by <a href="http://blogsessive.com" title="Blogging tips">Blogsessive - Blogging Tips</a>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please <a href="http://blogsessive.com/contact" title="Contact Blogsessive">contact us</a>, so that we can take legal action immediately.<img src="http://blogsessive.com/?ak_action=api_record_view&id=27&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blogsessive.com/blogging-tools/wordpress-template-tags-wp_get_archives/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

