<?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>Equal Design are WordPress Consultants, Web Design &#38; Computer Services in Leyland, Lancashire, Preston</title>
	<atom:link href="http://equaldesign.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://equaldesign.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 11 Apr 2010 14:06:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Viruses in USB&#8217;s / Cards / (even photoframes?)</title>
		<link>http://equaldesign.co.uk/blog/viruses-in-usbs-cards-even-photoframes/</link>
		<comments>http://equaldesign.co.uk/blog/viruses-in-usbs-cards-even-photoframes/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 10:28:05 +0000</pubDate>
		<dc:creator>Equal Design</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://equaldesign.co.uk/?p=305</guid>
		<description><![CDATA[We all know the risks (or do we?) of plugging things into a PC such as flash drives storage cards and disks, I recently had an issue where one of my directors had plugged a brand new (sealed) USB drive into his laptop copied a couple of spreadsheets onto the drive to transfer them to [...]]]></description>
			<content:encoded><![CDATA[<p>We all know the risks (or do we?) of plugging things into a PC such as flash drives storage cards and disks, I recently had an issue where one of my directors had plugged a brand new (sealed) USB drive into his laptop copied a couple of spreadsheets onto the drive to transfer them to his desktop PC.</p>
<p>On plugging the USB drive into his main pc our security (<a href="http://www.eset.co.uk/" target="_self">NOD32 by Eset</a>) kicked in and locked down a &#8216;known threat&#8217; this was kind of disturbing as I knew the drive was brand new (i gave it to him sealed) It seems the code that was infecting the drive was silently installing from his unprotected laptop and writing hidden files that executed the next time it was plugged into any machine. After some headscratching and scanning we got to the root of the problem and disinfected all machines/drives affected.</p>
<p>this took me on to read the following article which was again quite shocking:</p>
<blockquote><p><strong>Viruses found in photo frames, chargers</strong></p>
<p>Computer viruses are so clever they are always finding new ways to break into our computers.</p>
<p>Over the past few weeks viruses have been spread to computers from digital photo frames, battery chargers and even brand new smart phones.</p>
<p>What all of the devices have in common is that they are plugged into the USB port of your computer, which gives the virus an opportunity to go forth and multiply to cause havoc.</p>
<p>In the case of the phone it was found to contain no less than three viruses, including a Mariposa bot virus which &#8220;phones home&#8221; for more instructions once it lands in a computer.</p>
<p>No less an authority than the US Computer Emergency Readiness Team put out a warning about a common USB battery charger which came with optional software that contained a Trojan that allowed a hacker to remotely control a computer.</p>
<p>It is not known how many users have been infected by that software, which may have been around for three years.</p>
<p>The photo frames suffer from a similar back door hacker entry problem, which seems to stem from a period in which the viruses were particularly active around the world.</p>
<p>None of the distribution was wilful and stemmed from infected computers in the manufacturer accidentally passing on the viruses.</p>
<p>&#8220;This may simply be from that time frame when all the factories in China were not clean and many were putting malware on to stuff, not intentionally but because the hygiene wasn&#8217;t good,&#8221; said Marcus Sachs, director of the SANS Internet Storm Centre.</p>
<p>&#8220;Who knows where the server (hosting the software) is located. It could have been exposed to the unclean conditions that were rampant there.&#8221;</p>
<p>Fortunately most good virus protection programs seem to pick up and eradicate these threats because they have long been identified as a problem.</p>
<p>These examples do show how careful you need to be with any device that can be plugged into a computer.</p>
<p>Article from: News.com.au</p></blockquote>
<p>Be aware that everything you can attach to a computer can be affected by malicious code keep you AV solution up to date (as well as your operating system!)</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/viruses-in-usbs-cards-even-photoframes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fireworks and Snow Leopard</title>
		<link>http://equaldesign.co.uk/blog/fireworks-and-snow-leopard/</link>
		<comments>http://equaldesign.co.uk/blog/fireworks-and-snow-leopard/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 14:01:46 +0000</pubDate>
		<dc:creator>Equal Design</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://equaldesign.co.uk/?p=302</guid>
		<description><![CDATA[It seems there is battle happening inside my iMac between Adobe Fireworks and Snow Leopard  OS! Initially I presumed it was probably my lack of re-booting/updating that was causing the problem so I carried out the necessary updates (480mb!) for my CS4 design package, re-booted the iMac and hoped for the best.
I though as I had [...]]]></description>
			<content:encoded><![CDATA[<p>It seems there is battle happening inside my iMac between Adobe Fireworks and Snow Leopard  OS! Initially I presumed it was probably my lack of re-booting/updating that was causing the problem so I carried out the necessary updates (480mb!) for my CS4 design package, re-booted the iMac and hoped for the best.</p>
<p>I though as I had dismissed 480mb worth of updates for a while that was the most likely thing to be at the root of this problem. Wrong! Fireworks still hangs when I try to start it, and displays the not so helpful message &#8220;an internal error has occurred&#8221;. So off I go to the Adobe support site where I stumbled on a blog by one of their own developers that works for Adobe Systems on the Fireworks Engineering team.</p>
<p><a href="http://blogs.adobe.com/sarthak/2009/09/fireworks_and_snow_leopard.html" target="_blank">http://blogs.adobe.com/sarthak/2009/09/fireworks_and_snow_leopard.html</a></p>
<p>The 1st post in this thread was back in September 09 the most recent is from less than a week ago with around 90 comments on the post! Adobe need to address this issue. I will be checking this error at home this evening as im in the office right now (but do have a new 27&#8243; iMac at home).</p>
<p>Pretty poor support from a company of this size in my opinion!</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/fireworks-and-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multi Level WordPress Menu</title>
		<link>http://equaldesign.co.uk/blog/multi-level-wp-menu/</link>
		<comments>http://equaldesign.co.uk/blog/multi-level-wp-menu/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 15:16:53 +0000</pubDate>
		<dc:creator>Equal Design</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Menu]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=172</guid>
		<description><![CDATA[WordPress is an excellent CMS and I have used it on most of the projects that I have worked on recently.  The one thing however that can be a little tricky is multi-level page menus, when you have got several levels of parent/sub pages.  Whilst working on a large project recently I have come across [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress is an excellent CMS and I have used it on most of the projects that I have worked on recently.  The one thing however that can be a little tricky is multi-level page menus, when you have got several levels of parent/sub pages.  Whilst working on a large project recently I have come across a pretty good way of getting round this problem.</p>
<p>I was working on a site that required a multi-level page navigation system.  This primarily meant that when viewing a page the child pages of that page would need to be displayed in the sites sidebar.  <span id="more-314"></span>That in itself it not that difficult, but when you get several levels of pages it can be tricky.  The code below is what I am using which seems to work OK.  I will explain it beneath.</p>
<pre class="brush: php;">
&lt;?php global $post; $thispage = $post-&gt;ID; ?&gt;
&lt;?php $pagekids = get_pages(&quot;child_of=&quot;.$thispage.&quot;&amp;sort_column=menu_order&quot;); ?&gt;
&lt;?php if ($pagekids) { ?&gt;
  &lt;h2&gt;
   &lt;?php the_title(); ?&gt;
  &lt;/h2&gt;
  &lt;ul&gt;
    &lt;?php wp_list_pages(&quot;depth=1&amp;title_li=&amp;sort_column=menu_order&amp;child_of=&quot;.$thispage); ?&gt;
  &lt;/ul&gt;
&lt;?php } else { ?&gt;
  &lt;?php $ancestors = get_post_ancestors($post-&gt;ID); ?&gt;
  &lt;?php if($ancestors) { ?&gt;
    &lt;h2&gt;
      &lt;?php the_title(); ?&gt;
    &lt;/h2&gt;
    &lt;ul&gt;
      &lt;?php wp_list_pages(&quot;depth=1&amp;title_li=&amp;sort_column=menu_order&amp;child_of=&quot;.$post-&gt;post_parent); ?&gt;
    &lt;/ul&gt;
  &lt;?php } else { ?&gt;
    &lt;h2&gt;
      &lt;?php the_title(); ?&gt;
    &lt;/h2&gt;
  &lt;?php } ?&gt;
&lt;?php } ?&gt;
</pre>
<p>The first line of the code is all about getting the current page ID.  The code retrieves the page ID and stores this in a PHP variable <code>$thispage</code>.  The second line gets a list of all the child pages of the current page and stores then in the PHP variable <code>$pagekids</code>.  We then check whether <code>$pagekids</code> has any values or not.  If there are some values it means the current page has children, so we display them, if there are not any values then it means that the current page has no children.  If this is the case then we check to see if the current page has any ancestors.  If the current page has ancestors then we display a list of siblings and if there are no answers then it must mean that we are a the top level of pages and we can display nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/multi-level-wp-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an Avatar in Fireworks</title>
		<link>http://equaldesign.co.uk/blog/fireworks-avatar/</link>
		<comments>http://equaldesign.co.uk/blog/fireworks-avatar/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 18:32:52 +0000</pubDate>
		<dc:creator>Equal Design</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cartoon]]></category>
		<category><![CDATA[Fireworks]]></category>
		<category><![CDATA[Vector]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=125</guid>
		<description><![CDATA[Today I spent much of the day teaching about using Vector tools in Adobe Fireworks CS3 (yes we are out of date a little!).  My aim was to create an avatar character to represent you as a person, or perhaps what you would call a caricature using Fireworks, to express the benefits of using the vector [...]]]></description>
			<content:encoded><![CDATA[<p>Today I spent much of the day teaching about using Vector tools in Adobe Fireworks CS3 (yes we are out of date a little!).  My aim was to create an avatar character to represent you as a person, or perhaps what you would call a caricature using Fireworks, to express the benefits of using the vector tools rather than relying on bitmap tools all the time.  This post is to tell you how I got on!</p>
<h3>Inspriation</h3>
<p>I started out looking for inspiration, as I am sure all designers do.  I have never been an artist and probably never will be and therefore when it comes to drawing something I need all the help I can get.  <span id="more-125"></span>I found the image to the right, which I thought I could use as I wanted to draw my image in a suit. So the first thing I did was to use the Fireworks Pen tool in order to draw around the major features in order to give me an outline of the person.  This included <a href="http://www.imageenvision.com/clipart/28430-clip-art-graphic-of-a-geeky-white-businessman-cartoon-character-by-toons4biz"><img class="size-thumbnail wp-image-128 alignright" style="float: right;" title="markwilkinson-cartoon-inspiration" src="http://equalmark.net/wp-content/uploads/2010/02/markwilkinson-cartoon-inspiration-150x150.jpg" alt="" width="150" height="150" /></a>the face and eyes, ears and short as well as the trousers and shoes.  Once the outline was draw it was a matter of then using the Pen tool to round off all the corners of the shapes so that I had a nice rounded shirt, trousers etc rather than angular shapes.</p>
<p>It was then a matter of changing the shapes so that they fit my body shape and colour much better.  I am much slimmer than the cartoon above and wanted to exaggerate those features.  I also added some hair to the image as I am considerably younger than the cartoon image that provided the inspiration.</p>
<p>After a great deal of effort and a little help from a colleague we finally produced the Mark Wilkinson Avatar.  I am really rather proud of him actually!</p>
<p><a href="http://equaldesign.co.uk/wp-content/uploads/2010/02/markwilkinson-cartoon.jpg"><img class="alignnone size-full wp-image-130" title="Cartoon of Mark Wilkinson Drawn in Fireworks using Vector Tools" src="http://equaldesign.co.uk/wp-content/uploads/2010/02/markwilkinson-cartoon.jpg" alt="" width="500" height="800" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/fireworks-avatar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Coding</title>
		<link>http://equaldesign.co.uk/blog/cleancoding/</link>
		<comments>http://equaldesign.co.uk/blog/cleancoding/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 18:31:59 +0000</pubDate>
		<dc:creator>Equal Design</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=114</guid>
		<description><![CDATA[I have been coding websites now since late 2004, and I have learnt a lot in the time that I have been doing this.  In fact every day you learn things that you didn&#8217;t know, and a long the way I have learnt so much from others.  However the one thing that no one passed [...]]]></description>
			<content:encoded><![CDATA[<p>I have been coding websites now since late 2004, and I have learnt a lot in the time that I have been doing this.  In fact every day you learn things that you didn&#8217;t know, and a long the way I have learnt so much from others.  However the one thing that no one passed on to me was the importance of clean coding.  This is something that I had to learn for myself.  So what do I mean by clean coding and how does it help when creating a website?</p>
<p>Many beginners often use Web Editor programs such as Adobe Dreamweaver to create their websites, however as time has gone I have found it easier and easier to code the sites using a code editor rather than a WYSYWYG solution.  It is only then do you start to appreciate the need to clean code.<span id="more-114"></span></p>
<p>When completing a complex website you can end up with hundreds of lines of code for each of the template files that you are using. This is particularly the case if you are using Conditional Tags (which come in very handy when coding a WordPress site), where you need to enter code for each condition that you have on the page.  With this in mind is becomes essential that we create clean code so that we can easily read it when we may want to come back to it and edit it.  Take a look at the examples below:</p>
<h3>Unclean Code</h3>
<p><a href="http://equaldesign.co.uk/wp-content/uploads/2010/02/unclean-code.jpg"><img class="alignnone size-large wp-image-116" title="Un Clean, messy code that has no spaces between the lines and the tabbing is irregular" src="http://equalmark.net/wp-content/uploads/2010/02/unclean-code-498x139.jpg" alt="Unclean Code" width="498" height="139" /></a></p>
<p>In the code above you can see that there are no line spaces between blocks of code, which can cause confusion when reading it, as to which part of code does what.  Also the tabbing of the code is irregular and does not follow a neat pattern.</p>
<h3>Clean Code</h3>
<p><a href="http://equaldesign.co.uk/wp-content/uploads/2010/02/clean-code.jpg"><img class="alignnone size-large wp-image-115" title="Clean code has spaces between blocks of code and tabs when inside an element" src="http://equalmark.net/wp-content/uploads/2010/02/clean-code-498x225.jpg" alt="Clean Code" width="498" height="225" /></a></p>
<p>This example of clean code has line breaks between blocks of code and also elements that are within another element are tabbed to show they belong to the containing element.</p>
<h3>My Clean Coding Rules</h3>
<p>If you are writing code that sits inside another elements then always use the tab key before writing the code so that you know the code sits inside an element.  Therefore instead of this:</p>
<pre class="brush: xml;">
&lt;div class=&quot;box&quot;&gt;
&lt;p&gt;This is a paragraph inside the box div.&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>You would write this:</p>
<pre class="brush: xml;">
&lt;div class=&quot;box&quot;&gt;
    &lt;p&gt;This is a paragraph inside the box div.&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>Also spacing is important.  Purists would tell you otherwise, but I always find it easiest to leave a line between different elements so the code above would look like this:</p>
<pre class="brush: xml;">
&lt;div class=&quot;box&quot;&gt;

    &lt;p&gt;This is a paragraph inside the box div.&lt;/p&gt;

&lt;/div&gt;
</pre>
<p>Hopefully you can see that the code above is much clearer and easier to understand.  The final thing that I recommend when coding sites is that you place comments within your code so that you know what a specific piece of code does.  When you come back to view code in 6 &#8211; 12 months time it is not always as clear what certain code does as when you wrote it, and therefore it is important to comment the code to inform you of its function which can save you lots of time.</p>
<p>Depending on the code you are writing depends of how you comment it.  For example if you are writing in HTML I always comment closing &#8216;div&#8217; tags so I know which closing tag belongs to what.  For example:</p>
<pre class="brush: xml;">
&lt;div&gt;

    &lt;p&gt;This is a paragraph inside the box div.&lt;/p&gt;

&lt;/div&gt;&lt;!-- // box --&gt;
</pre>
<p>This makes it clear that the box div is closed.  When you have lots of code on the same page you can&#8217;t always see the closing &#8216;div&#8217; on the same screen and therefore this really helps.  If you are coding PHP you could comment like this:</p>
<pre class="brush: php;">
&lt;?php if(is_category(4) ) { ?&gt;
// checks to see if you are in category ID 4

    &lt;p&gt;You are in category 4&lt;/p&gt;

&lt;?php } ?&gt;
</pre>
<p>The two forward slashes inside the PHP tags indicate that you are quoting and this should be ignored when building the page. Again this is very handy when using conditional statements in PHP.</p>
<p>These simple things are the rules that I try to adopt when creating websites and they have served me well over the years and saved me lots of time.  It will be interesting to see what tips other web developer have.</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/cleancoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple iPad &#8211; My Thoughts</title>
		<link>http://equaldesign.co.uk/blog/appleipad/</link>
		<comments>http://equaldesign.co.uk/blog/appleipad/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 22:52:12 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=110</guid>
		<description><![CDATA[Finally last week Steve Jobs, Apple CEO announced the launch of Apple&#8217;s brand new product, the Apple iPad.  Rumours have been developing for months now on the Internet and now that the product has finally been revealed is it a good as all the hype built it up to be or should we be disappointed? [...]]]></description>
			<content:encoded><![CDATA[<p>Finally last week Steve Jobs, Apple CEO announced the launch of Apple&#8217;s brand new product, the Apple iPad.  Rumours have been developing for months now on the Internet and now that the product has finally been revealed is it a good as all the hype built it up to be or should we be disappointed?  Well a little of both maybe, so lets have a look.</p>
<p>My first disappointment was that it was exactly the product that everyone had been suggesting with the rumours.  Therefore Apple either did a really bad job of keeping it a secret or they were not that bothered about it leaking in the first place.<span id="more-110"></span>So what is the product and why is it different?  Well essentially it is a large iPhone, although Apple will not like me saying that.  It has a multi touch screen just like the iPhone and it is the same sort of size apart from much bigger (that doesn&#8217;t sound right but you get what I mean!).  It will run all the Apps that you have purchased for your iPhone and of course it can take advantage of all the Apps on sale in the Apple App store.  It will play music like your iPhone and connect to the iTunes store to purchase music. You can view photos and also browse the web and it even plays video.  All this sounds great, but I was left thinking, well what is the difference between this and the iPhone?</p>
<p><img class="alignnone size-large wp-image-111" title="apple-ipad" src="http://equalmark.net/wp-content/uploads/2010/02/apple-ipad-498x308.jpg" alt="" width="498" height="308" /></p>
<p>Well there are a couple of differences (other than size).  Firstly there is a new store the Apple are launching which is called the iBook store.  This is where you can buy books to then read on your iPad.  The iPad is very much a magazine size and therefore they are pushing the &#8216;eReader&#8217; market.  As well as the reading aspect Apple are launching iWork for the iPad so that you can use Keynote, Pages and Numbers on the iPad.  I am not convinced about these but time will tell I suppose.</p>
<p>So Steve Jobs told us that it will fill the gap between the smart phone (your iPhone or Blackberry) and the laptop.  Trouble is, is that I am not sure that there is a gap to be filled.  Steve Jobs says that it is the best device for browsing the web and emailing, but again I am not so sure.  I am usually browsing the web in order to find something or research something and therefore inevitably I will be wanting to have available all the other programs that my laptop contains at the same time.  The same when sending emails, I need my other programs open to action what the emails are saying.</p>
<p>I suppose what I am saying here is that I don&#8217;t need one and therefore I will not be buying one.  I mean it will never replace the smart phone because it is too big and it will never replace my laptop because it doesn&#8217;t do enough.  But the thing is you see, I am going to buy one!  Why?  Well they are just so cool and imagine showing off your portfolio to a client on an iPad?  That has got to have a good impact.</p>
<p>There is one main reason why I will most probably purchase an iPad and that is simply the price.  I think that everyone was expecting Apple to price the iPad at about the $1000 mark.  However at $499, assuming it will be the same or similar in the UK it is a very inexpensive device.  So will the iPad be a hit or will it be a gadget that everybody buys and then it phases out.  I am not entirely sure, but we won&#8217;t need to wait long to find out.</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/appleipad/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Protect WordPress Content</title>
		<link>http://equaldesign.co.uk/blog/protect-wordpress-content/</link>
		<comments>http://equaldesign.co.uk/blog/protect-wordpress-content/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:38:19 +0000</pubDate>
		<dc:creator>Equal Design</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Logged In]]></category>
		<category><![CDATA[Protect]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=101</guid>
		<description><![CDATA[I have been working on a number of sites recently that require several of the pages to be protected to logged in users only.  Also I have had one site where all pages which have a particular parent page needed protecting to logged in users only.  With some very handy built in WordPress functions and [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on a number of sites recently that require several of the pages to be protected to logged in users only.  Also I have had one site where all pages which have a particular parent page needed protecting to logged in users only.  With some very handy built in WordPress functions and a bit of PHP this post attempts to show you how this can be done.</p>
<p><a href="http://ict.ribbweb.org" target="_blank">Ribbweb ICT</a> runs WordPress and is used as a CMS in order to provide online resources for students to use.  It was decided that the site needed a section for just teachers to be able to use, where they can post protected content such as lesson plans, notes etc that website visitors cannot see but logged in users can.  <span id="more-101"></span>I decided that the best way to accomplish would be to create a page (we will call it &#8220;Resources&#8221;) and make this, and all its child pages protected. You can see that the link in the header only shows if you are logged in.</p>
<p><a href="http://equaldesign.co.uk/wp-content/uploads/2010/01/user-logged-in.jpg"><img class="alignnone size-large wp-image-106" title="user-logged-in" src="http://equalmark.net/wp-content/uploads/2010/01/user-logged-in-498x200.jpg" alt="" width="498" height="200" /></a></p>
<p>To start with we need to edit the page.php file in your themes template files.  In this file we need to set up an IF statement that checks to see whether the page you are currently viewing has the ancestor of the protected page (Resources).  First of all I used the following code in order to get all the ancestors of the current page:</p>
<pre class="brush: php;">[php]&lt;?php $ancestors = get_post_ancestors($post-&gt;ID); ?&gt;</pre>
<p>[/php]Now we have all the of the post IDs of the current pages ancestors stored as an array in a variable, we need to check whether the ID of the protected parent page (the Resources page) is contained in this list.  In this example the Resources page had the ID of 2. Therefore we use the following code to see if the ID of 2 is contained within the array:</p>
<pre class="brush: php;">&lt;?php if(in_array(&quot;2&quot;,$ancestors) ) { ?&gt;</pre>
<p>Now we know whether or not the we have an ancestor of the page that we want to protect, we need to check whether the user is logged in or not.  To do this we can use the WordPress function <code>is_user_logged_in()</code>.</p>
<pre class="brush: php;">

&lt;?php if (is_user_logged_in() ) { ?&gt;
&lt;?php include(TEMPLATEPATH.&quot;/page-content.php&quot;); ?&gt;
&lt;?php } else { ?&gt;
&lt;?php  include(TEMPLATEPATH.&quot;/loginform.php&quot;);
&lt;?php } ?&gt;
</pre>
<p>To keep things simple here I have included the login form and the page loop in separate files and then called those files in the code above.  So this code will show if we are on an ancestor of the Resources page, so the next thing we need to do is to check whether we are on the resources page itself.  To do this we need the following code:</p>
<pre class="brush: php;">
&lt;?php } elseif (is_page('2') ) { ?&gt;
// add the is_user_logged in loop here from above
</pre>
<p>Then finally to finish of our page we need to show how a normal page will display, without checking to see if the user is logged in or not.</p>
<pre class="brush: php;">
&lt;?php } else { ?&gt;
&lt;?php include(TEMPLATEPATH.&quot;/page-content.php&quot;); ?&gt;
&lt;?php } ?&gt;
</pre>
<p>So the code in full that you would need to use here is as follows:</p>
<pre class="brush: php;">
&lt;?php $ancestors = get_post_ancestors($post-&gt;ID); ?&gt;
&lt;?php if(in_array(&quot;2&quot;,$ancestors) ) { ?&gt;
   &lt;?php if (is_user_logged_in() ) { ?&gt;
      &lt;?php include(TEMPLATEPATH.&quot;/page-content.php&quot;); ?&gt;
   &lt;?php } else { ?&gt;
      &lt;?php  include(TEMPLATEPATH.&quot;/loginform.php&quot;);
   &lt;?php } ?&gt;
&lt;?php } elseif (is_page('2') ) { ?&gt;
   &lt;?php if (is_user_logged_in() ) { ?&gt;
      &lt;?php include(TEMPLATEPATH.&quot;/page-content.php&quot;); ?&gt;
   &lt;?php } else { ?&gt;
      &lt;?php  include(TEMPLATEPATH.&quot;/loginform.php&quot;);
   &lt;?php } ?&gt;
&lt;?php } else { ?&gt;
   &lt;?php include(TEMPLATEPATH.&quot;/page-content.php&quot;); ?&gt;
&lt;?php } ?&gt;
</pre>
<p>So there you have an easy way to check whether a WordPress page or post has a specified ancestor and then how to use that information to protect those page so that only logged in users to view them.  The is_user_logged_in() function has some very powerful uses in using WordPress as a content management system.</p>
<p><a href="http://equaldesign.co.uk/wp-content/uploads/2010/01/sidebar-user-logged-in.jpg"><img class="alignnone size-large wp-image-105" title="sidebar-user-logged-in" src="http://equalmark.net/wp-content/uploads/2010/01/sidebar-user-logged-in-497x223.jpg" alt="" width="497" height="223" /></a></p>
<p>I have also used this function in the sidebar of the site in order to display certain links to document that only teachers needed to see, such as lesson plans and answer sheets.  It works really well.</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/protect-wordpress-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colourful Quality Design</title>
		<link>http://equaldesign.co.uk/blog/webdesignsites/</link>
		<comments>http://equaldesign.co.uk/blog/webdesignsites/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:44:25 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Colour]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=92</guid>
		<description><![CDATA[I regularly check CSS Mania, which is a website that showcases excellent design in terms of CSS driven websites.  I would like to use this post to showcase three sites that I have recently seen that I find excellent examples.  All of these sites are websites that showcase web design services and each one provides [...]]]></description>
			<content:encoded><![CDATA[<p>I regularly check <a href="http://cssmania.com/" target="_blank">CSS Mania</a>, which is a website that showcases excellent design in terms of CSS driven websites.  I would like to use this post to showcase three sites that I have recently seen that I find excellent examples.  All of these sites are websites that showcase web design services and each one provides excellent examples of how to do it.<span id="more-92"></span></p>
<h3>Ben Sky</h3>
<p><a href="http://www.bensky.co.uk/" target="_blank"><img class="alignnone size-large wp-image-94" title="bensky" src="http://equalmark.net/wp-content/uploads/2010/01/bensky-498x225.jpg" alt="" width="498" height="225" /></a></p>
<p>I love this website mainly because of the way that the author has brought elements on his name into the site.  I suppose it makes it easier when you have a name that works well but he has pulled it off brilliantly.  Also I like the way in which he has chosen very bold colours and pulled them off.</p>
<h3>David Jonsson</h3>
<p><a href="http://davidjonsson.com.au/" target="_blank"><img class="alignnone size-large wp-image-96" title="davidjonson" src="http://equalmark.net/wp-content/uploads/2010/01/davidjonson-498x225.jpg" alt="" width="498" height="225" /></a></p>
<p>I looked at this site at first and though what great colour.  Actual on reflection when you study it further, it is mainly black and white, however it has very bold and colourful titles on each of the pages.  This seems to be something of a trend in recent sites as it seems to be showing up in more and more site and looking quite good.</p>
<h3>One Twenty Seven</h3>
<p><a href="http://www.onetwentyseven.com" target="_blank"><img class="alignnone size-large wp-image-93" title="1207" src="http://equalmark.net/wp-content/uploads/2010/01/1207-498x225.jpg" alt="" width="498" height="225" /></a></p>
<p>I love everything about this site, but there are two things that really caught my eye.  Firstly, I love the way in which the pages fades in and fades out when you click on one of the pages.  Secondly as you scroll down the page the logo on the left hand side follows you down the page, which then becomes your home link &#8211; very clever.</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/webdesignsites/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress&#8217; Dynamic Classes</title>
		<link>http://equaldesign.co.uk/blog/wordpress-dynamic-classes/</link>
		<comments>http://equaldesign.co.uk/blog/wordpress-dynamic-classes/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 10:00:56 +0000</pubDate>
		<dc:creator>Equal Design</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=82</guid>
		<description><![CDATA[For a while now WordPress has had the functionality for you to add dynamic classes to your posts and pages.  So what are dynamic classes, how do they work and how can they help you when creating a website using WordPress?  In this post I will try to answer these questions and more.
Dynamic means change [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now WordPress has had the functionality for you to add dynamic classes to your posts and pages.  So what are dynamic classes, how do they work and how can they help you when creating a website using WordPress?  In this post I will try to answer these questions and more.</p>
<p>Dynamic means change and that is exactly what WordPress&#8217; dynamic classes do.  If you add them to a post then they will change depending on which post your are looking at.  Lets take a look at some of the code for this site to give you an example.  Each post on this site is wrapped in a div tag with the class &#8216;post&#8217;.  <span id="more-311"></span>However this class is dynamic as it will change ever so slightly for each post.  For example the class for this post reads as follows:</p>
<pre class="brush: xml;">&lt;div class=&quot;post-82 post hentry category-tutorials tag-css tag-wordpress&quot;&gt;</pre>
<p>So what is going on there.  WordPress has assigned various classes to the post based on the properties that the post contains.  This post has been assigned the ID of 82 and therefore WordPress gives the post a class of &#8216;post-82&#8243;.  It is also assigned to the Tutorials category and therefore WordPress has also given it a class of &#8220;category-tutorials&#8221;.  This means that if I wanted to style something that is specific to this post (post ID 82) I can and also if I wanted to style something to show you that the post belongs to the Tutorials category I can.  In fact I have.  The post icon to the left of the post title is styled using this class.</p>
<p><a href="http://equaldesign.co.uk/wp-content/uploads/2010/01/dynamic-classes.jpg"><img class="alignnone size-large wp-image-88" title="dynamic-classes" src="http://equalmark.net/wp-content/uploads/2010/01/dynamic-classes-500x252.jpg" alt="" width="500" height="252" /></a></p>
<p>What is also important here is that WordPress also gives every post in this div the class &#8220;post&#8221;.  This means that I can style this particular div globally throughout the site and just style posts different based on the dynamic classes that are given as and when I choose.  The CSS that I have used for the post-meta div where the icon is located is below:</p>
<pre class="brush: css;">
#content .post .post-meta, #content .category-tutorials .post-meta, #content .category-design .post-meta, #content .category-portfolio .post-meta {
float: left;
display: inline;
width: 100px;
margin-right: 20px;
text-align: right;
background-image: url(images/cat-icon-general.jpg);
background-repeat: no-repeat;
background-position: left top;
padding-top: 40px;
margin-top: 6px;
font-size: 0.9em;
}
</pre>
<p>Then I can change the image for the post-meta area to represent the correct category using the following code, for example with the tutorials category, because I know that if a post is in that category it will have the class <code>#content .category-tutorials .post-meta</code>:</p>
<pre class="brush: css;">
#content .category-tutorials .post-meta {
background-image: url(images/cat-icon-tutorials.jpg);
}
</pre>
<p>So to add this example of dynamic classes to your theme simply replace:</p>
<pre class="brush: xml;">&lt;div class=&quot;post&quot;&gt;</pre>
<p>with the following:</p>
<pre class="brush: php;">&lt;div &lt;?php post_class() ?&gt;&gt;</pre>
<p>This is just one example of using dynamic classes in your WordPress site,but you could use them all over in order to completely customise the look and feel of the site just by using CSS functionlity.  Let me know how you get on.</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/wordpress-dynamic-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your Short URL for Twitter</title>
		<link>http://equaldesign.co.uk/blog/shorttwitterurl/</link>
		<comments>http://equaldesign.co.uk/blog/shorttwitterurl/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 23:15:27 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TinyURL]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://equalmark.net/?p=55</guid>
		<description><![CDATA[Everyone seems to be using Twitter at the moment and it was with this in mind that I decided to include in this site the &#8220;Tweet this Post&#8221; icon that you can see to the right of each post title.  What is a little different about this Tweet This button is that instead of using [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone seems to be using Twitter at the moment and it was with this in mind that I decided to include in this site the &#8220;Tweet this Post&#8221; icon that you can see to the right of each post title.  What is a little different about this Tweet This button is that instead of using one of the many URL shortening services, it uses WordPress functionality to keep the shortened URL on your own domain name.  This post with talk you though how I did this.</p>
<p>First of all it is nothing complicated.  The WordPress default permalink structure is always much shorter than the pretty permalink version of your URLs and therefore I thought why not use this when adding link to Twitter.  The problem is, is that you don&#8217;t want to change your permalink structure of your site just so that you can use the links in Twitter.  The great thing is, is that you don&#8217;t have to.<span id="more-55"></span><a href="http://equaldesign.co.uk/wp-content/uploads/2010/01/shorturl.jpg"><img class="alignnone size-large wp-image-68" title="Using a Shortened Version of Your Own Domain for Tweeting" src="http://equalmark.net/wp-content/uploads/2010/01/shorturl-500x255.jpg" alt="" width="500" height="255" /></a></p>
<p>Lets use this post as an example.  In the WordPress dashboard I can see that WordPress has assigned this post a post ID of 55. However the permalink of the post is &#8220;http://equalmark.net/tutorials/shorttwitterurls&#8221;.  This permalink is good as it makes sense to the reader, but it is long.  The great thing with WordPress is that if you actually use the non pretty permalink version i.e. http://equalmark.net/?p=55 it still takes you to the same post and replaces the URL with the correct &#8216;pretty&#8217; version.  So the question I was trying to solve was how to generate this link for each post.</p>
<p>The best way was to create a PHP function that could be used in your themes function.php file and then call the function wherever it is needed in the theme template files.  I added the following to functions.php.</p>
<pre class="brush: php;">

&lt;?php

// simple function to get a shortened version of your posts URL for twitter.  Uses the format yourdomain.com/?p=postid
function tweeturl() {
$thispost = bloginfo('url');
$tweetmiddle = &quot;/?p=&quot;;
global $wp_query;
$theid = $wp_query-&gt;post-&gt;ID;
echo $thispost . $tweetmiddle . $theid;
}
?&gt;
</pre>
<p>Lets just take a look at exactly what this does.  Line 4 sets up the name of the function that you need to call in your themes template files to make use of the functions.  Line 5 gets the blogs URL (in this case http://equalmark.net) and stores this in the variable $thispost.  Line 6 builds the middle part of the URL which all your posts will have and stores this in the variable $tweetmiddle. Line 7 and 8 get the current posts ID and then the rest is a matter of stitching everything together.</p>
<p>So to use this in your theme you will need to add the following to your themes template files:</p>
<pre class="brush: php;">&lt;?php tweeturl(); ?&gt;</pre>
<p>That code will output or echo the current posts URL in the shortened version.  I have used it on this site like this:</p>
<pre class="brush: php;">&lt;a href=&quot;http://twitter.com/home?status=Been reading this great article - &lt;?php tweeturl(); ?&gt;&quot;&gt;Tweet this Post&lt;/a&gt;</pre>
<p>The only different is instead of clicking on the text &#8220;Tweet this Post&#8221; I have replaced this with an image.</p>
<p>The benefits of using a function like this rather than one of the more popular URL shortening services is that whenever you want to include a link in your tweets that is your domain it means that you can keep your domain name in the actual Tweet content.  This means that more people will see your domain name and therefore could increase you traffic.  Let me know how you get on and any problems or issues (hopefully not) that you may come across.</p>
]]></content:encoded>
			<wfw:commentRss>http://equaldesign.co.uk/blog/shorttwitterurl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
