<?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>DER PRiNZ &#187; excerpt</title>
	<atom:link href="http://www.der-prinz.com/tag/excerpt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.der-prinz.com</link>
	<description>PREMIUM WORDPRESS THEMES</description>
	<lastBuildDate>Thu, 02 Feb 2012 22:16:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Custom Excerpt &#8220;more&#8221; Link in BranfordMagazine</title>
		<link>http://www.der-prinz.com/custom-excerpt-link-branfordmagazine/</link>
		<comments>http://www.der-prinz.com/custom-excerpt-link-branfordmagazine/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 21:49:18 +0000</pubDate>
		<dc:creator>Michael Oeser</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[BranfordMagazine]]></category>
		<category><![CDATA[excerpt]]></category>

		<guid isPermaLink="false">http://www.der-prinz.com/?p=960</guid>
		<description><![CDATA[Recently I have written about individual excerpt lenghts in BranfordMagazine. Today I will show you how to customize the excert &#8220;more&#8221; textstring and make it a real clickable link for a better user experience. Better user experience with clickable excerpt &#8220;more&#8221; By default the excerpt [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Recently I have written about <a href="http://www.der-prinz.com/individual-excerpt-lengths-branfordmagazine-4-935">individual excerpt lenghts</a> in BranfordMagazine. Today I will show you how to customize the excert &#8220;more&#8221; textstring and make it a real clickable link for a better user experience. </strong><br />
<span id="more-960"></span></p>
<h2>Better user experience with clickable excerpt &#8220;more&#8221;</h2>
<p>By default the excerpt of WordPress displays an un-clickable [...] at the end of the default 55 words. Well of course this makes the user somehow aware of the fact that there is more to read but he cannot click on the [...] string which causes irritations with less experienced users. Wouldn´t it be great if WordPress would add a real link at the end of an excerpt? Sure it would and here is how to do it.</p>
<h2>The Function</h2>
<p>Open your tools/various-functions.php file inside the branfordmagazine-pro themefolder and edit this (or similar) codesnippet:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="co1">// modify the excerpt &quot;more&quot; appearance an make it clickable</span><br />
<span class="kw2">function</span> new_excerpt_more<span class="br0">&#40;</span><span class="re0">$more</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="st0">&#8216;<br />
&lt;span class=&quot;excerpt_more&quot;&gt;&lt;a href=&quot;&#8217;</span>.get_permalink<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="st0">&#8216;&quot;&gt;&#8217;</span>.__<span class="br0">&#40;</span><span class="st0">&#8216;[continue reading...]&#8216;</span>,<span class="st0">&#8216;branfordmagazine&#8217;</span><span class="br0">&#41;</span>.<span class="st0">&#8216;&lt;/a&gt;&lt;/span&gt;&#8217;</span>;<br />
<span class="br0">&#125;</span><br />
add_filter<span class="br0">&#40;</span><span class="st0">&#8216;excerpt_more&#8217;</span>, <span class="st0">&#8216;new_excerpt_more&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
<p>In this example a link [continue reading...] will appear at the end of the excerpt after a linebreak. It is also prepared for localization. If you want something different just change the &#8220;[continue reading...]&#8221; string to e.g. &#8220;read on&#8221; or whatever you like. If you want the link to appear right behind the last word of the excerpt remove the < br / > tag.</p>
<p>Here is an example of three (clickable) dots right after the last word:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="co1">// modify the excerpt &quot;more&quot; appearance an make it clickable</span><br />
<span class="kw2">function</span> new_excerpt_more<span class="br0">&#40;</span><span class="re0">$more</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="st0">&#8216;&lt;span class=&quot;excerpt_more&quot;&gt;&lt;a href=&quot;&#8217;</span>.get_permalink<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="st0">&#8216;&quot;&gt;&#8230;&lt;/a&gt;&lt;/span&gt;&#8217;</span>;<br />
<span class="br0">&#125;</span><br />
add_filter<span class="br0">&#40;</span><span class="st0">&#8216;excerpt_more&#8217;</span>, <span class="st0">&#8216;new_excerpt_more&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
<h2>A little styling</h2>
<p>As you can see there is a CSS class called .excerpt_more. You can now style this class to meet your requirements. it can be found in the style.css file.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="coMULTI">/* &quot;more&quot; Links in the excerpts */</span><br />
<span class="re1">.excerpt_more</span> a <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">color</span>:<span class="re0">#<span class="nu0">840000</span></span>!important;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p><span class="re1">.excerpt_more</span> a<span class="re2">:hover</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; text-decoration<span class="re2">:none</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp;</div>
<h2>Works everywhere</h2>
<p>This little trick is not just for BranfordMagazine. You can use it with any theme as long as you run WordPress 2.9 or higher.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.der-prinz.com/custom-excerpt-link-branfordmagazine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using optional excerpts for more content control</title>
		<link>http://www.der-prinz.com/optional-excerpts-content-control/</link>
		<comments>http://www.der-prinz.com/optional-excerpts-content-control/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 22:41:32 +0000</pubDate>
		<dc:creator>Michael Oeser</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[content control]]></category>
		<category><![CDATA[excerpt]]></category>

		<guid isPermaLink="false">http://www.der-prinz.com/?p=939</guid>
		<description><![CDATA[In another article I already wrote about using individual excerpt lengths in BranfordMagazine. This brief tutorial shows you how to use individual excerpts for every post in order to get more control over your content. I use this in the leadarticle of my BranfordMagazine demosite. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>In another article I already wrote about using <a href="http://www.der-prinz.com/individual-excerpt-lengths-branfordmagazine-4-935">individual excerpt lengths</a> in BranfordMagazine. This brief tutorial shows you how to use individual excerpts for every post in order to get more control over your content. I use this in the leadarticle of my <a href="http://www.wp-themes.der-prinz.com/branfordmagazine/">BranfordMagazine demosite</a>.</strong><br />
<span id="more-939"></span><br />
When you write a post you will find an &#8220;excerpt&#8221; panel (German: &#8220;Auszug&#8221;) normally right below the text editor panel. You just have to type in whatever text you like and the_excerpt() template tag will use it for the excerpt automatically. The advantage here is that you can control the legth of the text and also use html formating such as bold text. </p>
<p>That´s it. Pretty easy. Isn´t it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.der-prinz.com/optional-excerpts-content-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Individual Excerpt lengths in BranfordMagazine</title>
		<link>http://www.der-prinz.com/individual-excerpt-lengths-branfordmagazine-4/</link>
		<comments>http://www.der-prinz.com/individual-excerpt-lengths-branfordmagazine-4/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:53:20 +0000</pubDate>
		<dc:creator>Michael Oeser</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[functions]]></category>

		<guid isPermaLink="false">http://www.der-prinz.com/?p=935</guid>
		<description><![CDATA[BranfordMagazine and also my other themes use the excerpt template tag for auto-shortening texts on the homepage and in other areas. This is nothing spectacular since many themes do it like that. But BranfordMagazine uses the power of WordPress 2.9x to provide a function for [...]]]></description>
			<content:encoded><![CDATA[<p><strong>BranfordMagazine and also my other themes use <a href="http://codex.wordpress.org/Template_Tags/the_excerpt">the excerpt template tag</a> for auto-shortening texts on the homepage and in other areas. This is nothing spectacular since many themes do it like that. But BranfordMagazine uses the power of WordPress 2.9x to provide a function for individual excerpt lengths. Be aware that this doesn´t work with WP versions prior to 2.9. By default this is used for shorter excerpts in the featured articles section. Of course you can use this technique with any of my premium WordPress themes.</strong><br />
<span id="more-935"></span></p>
<h2>How to use individual excerpt lengths</h2>
<p>Open your <code>/tools/various-functions.php</code>  file in the theme directory and look up the code below. You will see this (or a similar) function:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="co1">//modify the excerpt lenght in the &quot;featured articles&quot; section on the homepage</span><br />
add_filter<span class="br0">&#40;</span><span class="st0">&#8216;excerpt_length&#8217;</span>, <span class="st0">&#8216;my_excerpt_length&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">function</span> my_excerpt_length<span class="br0">&#40;</span><span class="re0">$length</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>in_category<span class="br0">&#40;</span><span class="nu0">4</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// put here the ID (4 by default) of the category used for the &quot;featured&quot; articles</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">25</span>; <span class="co1">// put the number of words (default 25)</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">55</span>; <span class="co1">// show 55 words for any other excerpt (or change this number also)</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span></div>
<p>I think it´s more or less self explaining. By default (and based on my demo site) it means that the excerpt of category 4 (featured articles) is limited to 25 words. The excerpt of any other category is limited to 55 words which is the WordPress default. Now you can easily change the lenght of your excerpts just by changing the numbers 25 and/or 55 to whatever you like. </p>
<h2>Extending the function</h2>
<p>You can also extend this function to archieve other categories to display different excerpt lengths. Try something like this:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span><br />
<span class="co1">//modify the excerpt lenght in the &quot;featured articles&quot; section on the homepage</span><br />
add_filter<span class="br0">&#40;</span><span class="st0">&#8216;excerpt_length&#8217;</span>, <span class="st0">&#8216;my_excerpt_length&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">function</span> my_excerpt_length<span class="br0">&#40;</span><span class="re0">$length</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>in_category<span class="br0">&#40;</span><span class="nu0">4</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// put here the ID (4 by default) of the category used for the &quot;featured&quot; articles</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">25</span>; <span class="co1">// put the number of words (default 25)</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">elseif</span><span class="br0">&#40;</span>in_category<span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// put here the ID of the category </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">75</span>; <span class="co1">// put the number of words (default 25)</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">55</span>; <span class="co1">// show 55 words for any other excerpt (or change this number also)</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span></div>
<p>It´s up to you now. Play around with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.der-prinz.com/individual-excerpt-lengths-branfordmagazine-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 34/51 queries in 0.018 seconds using disk: basic
Object Caching 972/999 objects using disk: basic

Served from: www.der-prinz.com @ 2012-02-04 05:00:32 -->
