<?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>Design Nudge &#187; Wordpress</title>
	<atom:link href="http://www.designnudge.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designnudge.com</link>
	<description>Custom Website Design, Wordpress Themes by a freelancer based in the North East of England.</description>
	<lastBuildDate>Sat, 15 Aug 2009 09:02:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Breadcrumb Navigation</title>
		<link>http://www.designnudge.com/2009/wordpress-breadcrumb-navigation/</link>
		<comments>http://www.designnudge.com/2009/wordpress-breadcrumb-navigation/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 06:10:10 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.designnudge.com/?p=81</guid>
		<description><![CDATA[Need a Wordpress breadcrumb navigation trail for your Wordpress theme, but do not want to rely on a plugin?
If you want your Wordpress theme to stand out from the crowd it is worth considering implementing a breadcrumb navigation trail. A breadcrumb trail can make it easier for your site visitors [..]]]></description>
			<content:encoded><![CDATA[<p><em>Need a <strong>Wordpress breadcrumb navigation</strong> trail for your Wordpress theme, but do not want to rely on a plugin?</em></p>
<p>If you want your Wordpress theme to stand out from the crowd it is worth considering implementing a breadcrumb navigation trail. A breadcrumb trail can make it easier for your site visitors to identify what page they are currently viewing.</p>
<p>Plugins like <a href="http://wordpress.org/extend/plugins/breadcrumb-navxt/">Breadcrumb NavXT</a> are available that will automatically produce a breadcrumb trail for you. However, if you are looking for an easier method that does not require a plugin the below solution should help.</p>
<p><strong>Breadcrumb.php code</strong></p>
<p>Copy the below code into a new file called <strong>breadcrumb.php</strong> &#8211; make sure this file is in your root theme folder. </p>
<pre class="brush: php;">
&lt;div id=&quot;breadcrumb&quot;&gt;
  &lt;?php /* If this is the homepage */ if (is_home()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php /* If this is a tag archive */ if (is_tag() ) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;#&quot; rel=&quot;bookmark&quot; title=&quot;Posts Tagged &amp;#8216;&lt;?php single_tag_title(); ?&gt;&amp;#8217;&quot;&gt;Posts Tagged &amp;#8216;
    &lt;?php single_tag_title(); ?&gt;
    &amp;#8217;&lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php /* If this is a category archive */ if (is_category()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;#&quot; title=&quot;&lt;?php single_cat_title(); ?&gt;&quot;&gt;
    &lt;?php single_cat_title(); ?&gt;
    &lt;/a&gt; &lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php if /* If this is a page */ (is_page()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo;
    &lt;?php
	global $wp_query;
	if (empty($wp_query-&gt;post-&gt;post_parent) ) {
		$parent = $wp_query-&gt;post-&gt;ID;
		echo '';
	} else {
		$parent = $wp_query-&gt;post-&gt;post_parent;
		echo '&lt;a href=&quot;'.get_permalink($parent).'&quot;&gt;'.get_the_title($parent).'&lt;/a&gt; &amp;raquo;';
	}
?&gt;
    &lt;a href=&quot;&lt;?php echo get_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: &lt;?php the_title(); ?&gt;&quot;&gt;
    &lt;?php the_title(); ?&gt;
    &lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php if /* If this is a blog post */ (is_single()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo;
    &lt;?php the_category(', ') ?&gt;
    &amp;raquo; &lt;a href=&quot;&lt;?php echo get_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: &lt;?php the_title(); ?&gt;&quot;&gt;
    &lt;?php the_title(); ?&gt;
    &lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php if /* If this is a search page */ (is_search()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php /* If this is a 404 page */ if (is_404()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;#&quot; title=&quot;404 Error page&quot;&gt;404 Error&lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php /* If this is a yearly archive */ if (is_year()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;/archives&quot; title=&quot;archives&quot;&gt;&lt;span&gt;archives&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;#&quot; title=&quot;Year&quot;&gt;
    &lt;?php the_time('Y'); ?&gt;
    &lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php /* If this is a monthly archive */ if (is_month()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;/archives&quot; title=&quot;archives&quot;&gt;&lt;span&gt;archives&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;#&quot; title=&quot;Month&quot;&gt;
    &lt;?php the_time('F, Y'); ?&gt;
    &lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php /* If this is a daily archive */ if (is_day()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;/archives&quot; title=&quot;archives&quot;&gt;&lt;span&gt;archives&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;#&quot; title=&quot;Month&quot;&gt;
    &lt;?php the_time('F jS, Y'); ?&gt;
    &lt;/a&gt;&lt;/p&gt;
  &lt;?php } ?&gt;
  &lt;?php /* If this is a author archive */ if (is_author()) { ?&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt; &amp;raquo; &lt;a href=&quot;&lt;?php bloginfo('siteurl'); ?&gt;/archives&quot; title=&quot;archives&quot;&gt;&lt;span&gt;authors&lt;/span&gt;&lt;/a&gt; &amp;raquo;
    &lt;?php the_author_posts_link(); ?&gt;
    &lt;?php
if(isset($_GET['author_name'])) :
$curauth = get_userdatabylogin($author_name);
else :
$curauth = get_userdata(intval($author));
endif;
?&gt;
    &lt;a title=&quot;&lt;?php echo $curauth-&gt;display_name; ?&gt;'s posts&quot; href=&quot;#&quot;&gt;&lt;?php echo $curauth-&gt;display_name; ?&gt;&lt;/a&gt; &lt;/p&gt;
  &lt;?php } ?&gt;
&lt;/div&gt;
&lt;!-- end breadcrumb --&gt;
</pre>
<p>Call the above template anywhere in your theme files (usually in header.php) using the following code:</p>
<pre class="brush: php;">
&lt;?php include (TEMPLATEPATH . &quot;/breadcrumb.php&quot;); ?&gt;
</pre>
<p>The end HTML result will look something like this:</p>
<pre class="brush: xml;">
&lt;div id=&quot;breadcrumb&quot;&gt;
  &lt;p&gt; &lt;strong&gt;You are here:&lt;/strong&gt; &lt;a href=&quot;http://yoursitename.com&quot; title=&quot;home&quot;&gt;&lt;span&gt;home&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!-- end breadcrumb --&gt;
</pre>
<p><strong>Known issues!</strong></p>
<p>This does not work for Grandchild categories. In my experience, grandchild categories are used very rarely. If you have found a workaround or any improvements to this code let me know. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.designnudge.com/2009/wordpress-breadcrumb-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide images from guests in Wordpress!</title>
		<link>http://www.designnudge.com/2009/hide-images-from-guests-in-wordpress/</link>
		<comments>http://www.designnudge.com/2009/hide-images-from-guests-in-wordpress/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 18:08:23 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[hide images from guests]]></category>

		<guid isPermaLink="false">http://www.designnudge.com/?p=37</guid>
		<description><![CDATA[If need to hide images from guests (users that are not registered) on your Wordpress blog this function should help.
Why would I need to hide images from guests?
You may have some images that you only want registered users to view on your blog. For example, you may be a photographer [..]]]></description>
			<content:encoded><![CDATA[<p>If need to <strong>hide images from guests</strong> (users that are not registered) on your Wordpress blog this <a href="#function1">function</a> should help.</p>
<p><strong>Why would I need to hide images from guests?</strong></p>
<p>You may have some images that you only want registered users to view on your blog. For example, you may be a photographer that would like to show your latest great shot to a select number of registered users. Making content available to registered only users can be a great incentive for your readers to register on your blog.</p>
<p>Simple add the below code to the top of your theme&#8217;s functions.php after the opening php tag. </p>
<p><strong id="function1">PHP Function / Hide images</strong></p>
<pre>
if ( is_user_logged_in() ) {

} else {
	add_filter('the_content','wpi_image_content_filter',11);

function wpi_image_content_filter($content){

    if (is_single() || is_front_page || is_home ()){
      $content = preg_replace("/<img[^>]+\>/i", "" />", $content);

    }

    return $content;
}
}
</pre>
<p><em>Please note:</em> the function will not block image links, so guests could still view the source image if they click on the image. To avoid this do not add links to inserted images. </p>
<p>Alternatively, use the below function to block images and links. <strong>Be careful</strong>, as this will remove (hide) all links in your blog posts.</p>
<p><strong>PHP Function / Hide images and links</strong></p>
<pre>
if ( is_user_logged_in() ) {

} else {
	add_filter('the_content','wpi_image_content_filter',11);

function wpi_image_content_filter($content){

    if (is_single() || is_front_page || is_home ()){
      $content = preg_replace("/<a[^>]+href[^>]+>/", "", $content);
      $content = preg_replace("/<img[^>]+\>/i", "" />", $content);

    }

    return $content;
}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.designnudge.com/2009/hide-images-from-guests-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use a current page marker in Wordpress!</title>
		<link>http://www.designnudge.com/2008/how-to-use-a-current-page-marker-in-wordpress/</link>
		<comments>http://www.designnudge.com/2008/how-to-use-a-current-page-marker-in-wordpress/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 20:07:06 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.designnudge.com/?p=21</guid>
		<description><![CDATA[&#8220;Current page markers&#8221; are a great way for web designers to illustrate to the reader what page they are currently viewing. &#8220;Current page markers&#8221; use the same principle as breadcrumb trails but are generally less obtrusive. &#8220;Current page markers&#8221; are suitable for small to medium sized websites.


Breadcrumb trail

Guardian.co.uk is a [..]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Current page markers&#8221; are a great way for web designers to illustrate to the reader what page they are currently viewing. &#8220;Current page markers&#8221; use the same principle as breadcrumb trails but are generally less obtrusive. &#8220;Current page markers&#8221; are suitable for small to medium sized websites.<span id="more-21"></span></p>
<div class="postwrap">
<div class="width-300-left">
<h5>Breadcrumb trail</h5>
<p class="caption"><img title="guardian-screen" src="http://www.designnudge.com/wp-content/uploads/2008/09/guardian-screen.jpg" alt="Screen gran taken from Guardian.co.uk" width="250" height="100" /><em><br />
<a href="http://www.guardian.co.uk">Guardian.co.uk</a> is a good example of how to add style to a breadcrumb trail.</em></p>
</div>
<div class="width-300-right">
<h5>Current Page Marker</h5>
<p class="caption"><img class="alignnone size-full wp-image-23" title="Design Nudge" src="http://www.designnudge.com/wp-content/uploads/2008/09/dn-mark-screen1.jpg" alt="Design Nudge Navigation Screen grab" width="250" height="100" /><br />
<em>At Design Nudge I opted for a current page marker over a breadcrumb trail.</em></p>
</div>
</div>
<h4 style="clear:both">Using &#8220;current page markers&#8221; in Wordpress?</h4>
<p>In this tutorial I will be using examples and screen grabs from the default 1.6 Wordpress theme. &#8220;Current page markers&#8221; are already available in Wordpress but they are disabled in the default Wordpress theme. To enable page markers simple style and add the following CSS class to your stylesheet (style.css):</p>
<pre><strong>.current_page_item</strong> {font-weight: bold; font-style: italic}</pre>
<p>Using the above CSS class the page link text will change to <em><strong>bold italic</strong></em> when the user is browsing that particular page:</p>
<p><img class="alignnone size-full wp-image-24" title="Wordpress Marker" src="http://www.designnudge.com/wp-content/uploads/2008/09/default-marker.jpg" alt="Example of a page marker " width="579" height="300" /></p>
<h4>How to add a &#8220;current page marker&#8221; to your homepage in Wordpress!</h4>
<p>So you now know how to add &#8220;current page markers&#8221; to Wordpress pages, but what about the hompage? In this quick tutorial I&#8217;m going to demonstrate how to implement a &#8220;current page marker&#8221; for your homepage into any Wordpress theme. Do not take the whole day off work as this tutorial should not take long.</p>
<p>1. First you need to delete the old wp_list_pages function which can be found in your themes sidebar (sidebar.php):</p>
<pre>&lt;?php wp_list_pages('title_li=&lt;h2&gt;Pages&lt;/h2&gt;' ); ?&gt;</pre>
<p>2. We will now create a new wp_list_pages with a simple PHP if/elseif statement. So, if this is the homepage current_page_item will be added as a class to the &lt;li&gt; element, <span>alternatively </span> if this is not the homepage, page_item_home will be added as a class to the &lt;li&gt; element. Copy and paste the following code where the old wp_list_pages statement was located.</p>
<blockquote><p>&lt;h2&gt;Pages&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;?php /* If this is the homepage   */ if (is_home()) { ?&gt;<br />
&lt;li class=&quot;current_page_item&quot;&gt;<br />
&lt;a   href=&quot;&lt;?php echo get_option(’home’); ?&gt;/&quot;   title=&quot;homepage&quot;&gt;Home&lt;/a&gt;<br />
&lt;/li&gt;<br />
&lt;?php } else {   ?&gt;<br />
&lt;li class=&quot;page_item_home&quot;&gt;<br />
&lt;a href=&quot;&lt;?php echo   get_option(’home’); ?&gt;/&quot;   title=&quot;homepage&quot;&gt;home&lt;/a&gt;<br />
&lt;/li&gt;<br />
&lt;?php }   ?&gt;<br />
&lt;?php<br />
$pages = wp_list_pages(’title_li=&amp;echo=0′);<br />
echo   $pages;<br />
?&gt;<br />
&lt;/ul&gt;</p></blockquote>
<p>You may have noticed that I have removed the &lt;li&gt; elements within wp_list_pages and moved the &lt;h2&gt; elements outside the code &#8211; this is needed so the extra homepage link is included within the list.</p>
<p>3. And that&#8217;s it, you should now have a new homepage link and current page markers in your sidebar.</p>
<p><img class="alignnone size-full wp-image-25" title="default-marker-home" src="http://www.designnudge.com/wp-content/uploads/2008/09/default-marker-home.jpg" alt="Current Page Marker on Homepage" width="579" height="300" /></p>
<p class="caption"><em>Having trouble getting it working?, found a better way? Feel free to leave feedback using the comment form below.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designnudge.com/2008/how-to-use-a-current-page-marker-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
