<?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>Van SEO Design &#187; WordPress</title>
	<atom:link href="http://www.vanseodesign.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vanseodesign.com</link>
	<description>Helping you build search engine friendly websites</description>
	<lastBuildDate>Thu, 09 Feb 2012 15:26:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Earn More By Becoming An Efficient Web Designer</title>
		<link>http://www.vanseodesign.com/wordpress/efficient-web-design/</link>
		<comments>http://www.vanseodesign.com/wordpress/efficient-web-design/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 17:24:06 +0000</pubDate>
		<dc:creator>Steven Bradley</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.vanseodesign.com/?p=952</guid>
		<description><![CDATA[Time is an important factor in how much money you make as a web designer. Your primary cost on any project is the time it takes you to complete that project. Learning to work more efficiently will save you time leading to more profitable projects. You can then take the time you saved to either [...]]]></description>
			<content:encoded><![CDATA[<p>Time is an important factor in how much money you make as a web designer. Your primary cost on any project is the time it takes you to complete that project. Learning to work more efficiently will save you time leading to more profitable projects. You can then take the time you saved to either have more free time or take on more projects to make more money.</p>
<p>Price = Rate x Time<br />
Rate = Price / Time</p>
<p>Reduce your time while holding your price constant and your rate goes up. It&#8217;s in your best interest to work more efficiently and without too much effort you <strong>can</strong> get more done in less time.<br />
<span id="more-952"></span><br />
<a href="http://www.flickr.com/photos/28581290@N08/3930943054/" title="honeycomb" target="_blank"><img src="http://farm3.static.flickr.com/2571/3930943054_79198df60e_m.jpg" alt="honeycomb" border="0" width-"465" height="290" /></a><br /><small><a href="http://creativecommons.org/licenses/by-sa/2.0/" title="Attribution-ShareAlike License" target="_blank"><img src="http://www.vanseodesign.com/blog/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/28581290@N08/3930943054/" title="romana klee" target="_blank">romana klee</a></small></p>
<h2>Identify Repetition in your Work</h2>
<p>Sure design is a creative process and every design is unique. Still there are plenty of things you do from one site to the next that are very much the same. Why reinvent the wheel?</p>
<p>The next site you design and develop is going to have some kind of navigation. How many different navigational systems do you use? Odds are your next navigational system will fall into one of the following three categories:</p>
<ul>
<li>horizontal navigation bar</li>
<li>vertical menu system</li>
<li>tag based navigational links</li>
</ul>
<p>You&#8217;ll likely use one of the first two. Your next <a href="http://www.vanseodesign.com/css/simple-navigation-bar-with-css-and-xhtml/">navigation bar</a> won&#8217;t look exactly like your last one, but it will (or should) be built from an html list and styled with similar css. Your navigation bars will inevitably have many repeating elements that don&#8217;t need to be recreated from scratch with each new site.</p>
<p>Pay attention and start to identify where you repeat work from one project to the next.</p>
<h2>Build a Library of Reusable Code and Graphic Elements</h2>
<p>As you identify repeating elements, start saving them and building a library for reuse. Take that code for your menu and save it. When it&#8217;s time to <a href="http://www.vanseodesign.com/blog/css/simple-menus-with-xhtml-lists-and-css/">code a menu</a> in your next website grab that code as a starting point.</p>
<div class="alignleft">
<a href="http://www.flickr.com/photos/41454560@N04/3984500567/" title="New and Used" target="_blank"><img src="http://farm4.static.flickr.com/3203/3984500567_1e0e3c6b0e_m.jpg" alt="New and Used" border="0" width="180" height="272" /></a><br /><small><a href="http://creativecommons.org/licenses/by-nd/2.0/" title="Attribution-NoDerivs License" target="_blank"><img src="http://www.vanseodesign.com/blog/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/41454560@N04/3984500567/" title="ilovememphis" target="_blank">ilovememphis</a></small>
</div>
<p>Even better get a code editor that allows you to save code snippets or lets you use shortcuts to enter larger blocks of code.</p>
<p>I currently use Coda as my editor of choice and through it&#8217;s clips panel I can build the basic shell of a site in a few seconds. Many code editors offer similar functionality. It&#8217;s time to stop using Notepad and invest in something better.</p>
<p>Do you use buttons in your designs? How different are they really? Do you save PSD files for each type of button you use? Why not?</p>
<p>Saving graphic elements like buttons and icons or using those others create for you is a great way to save time on projects.</p>
<p>Take a few seconds to save code snippets from your current project. Make some time each week to write code you know you&#8217;ll use on future sites. Go through your existing library and improve it. Design a better button. Improve the code of your navigation bar.</p>
<h2>Think Object Oriented</h2>
<p>At least in terms of it&#8217;s benefits. <a href="http://dotnetperls.com/object-oriented-benefits">Object oriented thinking</a> leads to:</p>
<ul>
<li>Faster development</li>
<li>Reuse of previous work</li>
<li>Increased quality</li>
<li>Modular architecture</li>
</ul>
<p>By isolating work you&#8217;ve previously done for reuse, you can design and build new sites faster and work to improve those small blocks of code and graphic elements in between projects. Modular architecture allows you to drop in components into any project and again improve those modules in between projects.</p>
<p>Even something like css which might not obviously lend itself to objects can be <a href="http://net.tutsplus.com/tutorials/html-css-techniques/object-oriented-css-what-how-and-why/">written in a  more object-oriented way</a>. </p>
<h2>Develop Processes for Everything</h2>
<p>You likely have a similar workflow from site to site. That workflow is your <a href="http://www.vanseodesign.com/design/process/">design process</a>. It may vary some from site to site, but by following the same general roadmap you give yourself direction and ultimately work faster and smarter.</p>
<p>Your processes don&#8217;t have to be limited to your design work however. Develop systems for everything you do in your business. Save email templates for common replies. Use a billing program to send and keep track of invoices. Automate repetitive tasks where possible.</p>
<p>Systems and processes keep you from reinventing the wheel over and over. When you find a process that works stick to it. Don&#8217;t solve the same problem again and again. Once you have systems in place you can improve them and make them more efficient, but get them in place.</p>
<h2>Manage Your Time Better</h2>
<p>We all procrastinate. We all let things distract us. We all know we shouldn&#8217;t do either. Time management is more than avoiding work. It&#8217;s about figuring out when you work best.</p>
<div class="alignright">
<a href="http://www.flickr.com/photos/27670134@N05/3989254736/" title="Sundial" target="_blank"><img src="http://farm4.static.flickr.com/3604/3989254736_dcffcc371b_m.jpg" alt="Sundial" border="0" width="220" height="330" /></a><br /><small><a href="http://creativecommons.org/licenses/by-sa/2.0/" title="Attribution-ShareAlike License" target="_blank"><img src="http://www.vanseodesign.com/blog/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/27670134@N05/3989254736/" title="Quinn Dombrowski" target="_blank">Quinn Dombrowski</a></small>
</div>
<p>Are you most productive in the morning? The afternoon? Evenings? Late night? Are you able to work better at some things early in the day and others come better after lunch?</p>
<p>I find I&#8217;m <a href="http://www.vanseodesign.com/blogging/walking-creative-path/">most creative</a> in the morning and <a href="http://www.vanseodesign.com/online-business/late-night-creativity/">late at night</a>. In between creativity is a struggle for me. I no longer begin a new design in the afternoon. A blog post I can write in an hour in the morning will take me 2 &#8211; 3 hours in the afternoon and it won&#8217;t turn out as well. On the other hand I can be analytical at any time of day. Late afternoon I&#8217;m useless for most work so I run life&#8217;s errands instead.</p>
<p>Schedule different tasks at different times of day. Writing in the morning, coding in the afternoon, designing at night works for me. It helps me finish each faster and better. The tasks and times may be different for you, but chances are you do certain things more efficiently at different times throughout the day or week.</p>
<p>Speaking of schedules, learn to set one. Plan out your most important projects during the week and set aside time for them every day. You&#8217;ll be amazed at how much more you can get done when it&#8217;s set out in front of you on a calendar.</p>
<p>One day each week I map out what I want to get done and start blocking out times for each task on my calendar.  I&#8217;ll adjust as the week progresses, but I always find I get more done when I fill in the calendar. When I don&#8217;t it&#8217;s much easier to let the procrastination and distractions creep back into my week.</p>
<h2>Summary</h2>
<p>Think again of the simple pricing formula at the start of this post.</p>
<p>Price = Rate x Time<br />
Rate = Price / Time</p>
<p>You likely charge the same amount for the same kind of project. If you reduce the time it takes to complete a project then you earn a higher rate on that project. A higher rate means you can either work less or make more money. Either sounds good to me.</p>
<p>What tips do you have for working more efficiently?</p>
<img src="http://www.vanseodesign.com/blog/?ak_action=api_record_view&id=952&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.vanseodesign.com/wordpress/efficient-web-design/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How To Create a Dropdown Menu In WordPress</title>
		<link>http://www.vanseodesign.com/wordpress/how-to-create-a-dropdown-menu-in-wordpress/</link>
		<comments>http://www.vanseodesign.com/wordpress/how-to-create-a-dropdown-menu-in-wordpress/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 13:00:19 +0000</pubDate>
		<dc:creator>Steven Bradley</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=728</guid>
		<description><![CDATA[At some point when working with WordPress you&#8217;ll likely want to display your page links in a dropdown navigation bar. While there are many plugins that will do this for you, none are necessary as coding a dropdown menu in a WordPress theme is rather easy.

Below I&#8217;ll show two simple ways to have WordPress create [...]]]></description>
			<content:encoded><![CDATA[<p>At some point when working with WordPress you&#8217;ll likely want to display your page links in a dropdown <a href="http://www.vanseodesign.com/blog/css/simple-navigation-bar-with-css-and-xhtml/">navigation bar</a>. While there are many <a href="http://wordpress.org/extend/plugins/tags/dropdown">plugins</a> that will do this for you, none are necessary as coding a dropdown menu in a WordPress theme is rather easy.<br />
<span id="more-728"></span><br />
Below I&#8217;ll show two simple ways to have WordPress create the html for a flexible and dynamic drop down menu in your theme. I won&#8217;t be covering the css styling in the post. If you&#8217;re unfamiliar with how to develop drop down menus in general here are two posts that will show you how.</p>
<ul>
<li><a href="http://htmldog.com/articles/suckerfish/">Sons of Suckerfish</a></li>
<li><a href="http://www.cssplay.co.uk/menus/final_drop.html">The ULTIMATE CSS only drop-down menu</a></li>
</ul>
<p>I&#8217;ve been using the Suckerfish menu for years. It&#8217;s fairly easy to understand and uses a very small JavaScript file for older version of Internet Explorer. I believe IE8 no longer needs the JavaScript, but all previous versions do. I may be wrong about it being necessary for IE7, but it&#8217;s definitely needed for IE6 and below.</p>
<p>The second link above is an example of a css only drop-down. You&#8217;ll have to view the source code to see how it&#8217;s done. I&#8217;ve never used it myself, but the author, Stu Nicholls  has tested it across many browsers and versions.</p>
<h2>Typical HTML in a Drop Down</h2>
<p>In general any time you want to create a menu or navigation bar think unordered lists in your html. For a typical dropdown menu your html might look something like the following:</p>
<pre class="html">
<span class="htmlOtherTag">&lt;ul id=<span class="htmlAttributeValue">&quot;nav&quot;</span>&gt;</span>
  <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
  <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;/a&gt;</span>
    <span class="htmlOtherTag">&lt;ul&gt;</span>
      <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
      <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
    <span class="htmlOtherTag">&lt;/ul&gt;</span>
  <span class="htmlOtherTag">&lt;/li&gt;</span>
  <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
<span class="htmlOtherTag">&lt;/ul&gt;</span>
</pre>
<p>The code above is a simple nested list. Two keys to note are first that the nested list comes before the closing &lt;/li&gt; of the menu item that will contain the drop down. A common mistake is to forget to add the nested list inside the list item. The other key is we&#8217;ve given the outside &lt;ul&gt; an id so we can hook into it through our css.</p>
<p>Again I&#8217;ll point you to either of the two links above for styling a drop down menu. If you&#8217;d like me to write a post in the future showing the css and developing the full menu from scratch, leave a comment below.</p>
<h2>Creating the HTML in WordPress</h2>
<p>Editing the css file of a WordPress theme is straightforward. The hard part in creating the dropdown navigation is getting WordPress to display something close to the html above. Many people will hard code the html into their header.php file and while that works, it&#8217;s not particularly flexible. If you add a new menu item, you need to add another line of html in the appropriate place.</p>
<p>A better solution is to use a WordPress template tag to produce our html. There are two template tags that can produce the code we want. One has been around for years and one has only been with is since WordPress 2.7. Each has its advantages.</p>
<ul>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages()</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_page_menu">wp_page_menu()</a></li>
</ul>
<h2>Dropdowns with wp_list_pages()</h2>
<p>wp_list_pages() has been around for awhile. It outputs your pages as a series of links wrapped in list tags. Odds are your current theme uses this tag to produce your navigation. Not everyone knows how to use this tag to produce nested lists of pages, but it&#8217;s rather easy with the use of one parameter you include in the tag.</p>
<pre class="css">
&lt;ul id=<span class="cssString">"nav"</span>&gt;
  &lt;li id=<span class="cssString">"home"</span> &lt;?php if(is_page(<span class="cssString">&#039;home&#039;</span>)){echo <span class="cssString">"class=current_page_item"</span>&#59<span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"/index.php"</span>&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;?php wp_list_pages(<span class="cssString">&#039;title_li=&amp;sort_column=menu_order&amp;depth=2&#039;</span>); ?&gt;
&lt;/ul&gt;
</pre>
<p>wp_list_pages() produces the list items, but not the &lt;ul&gt;&lt;/ul&gt; so I&#8217;ve hard coded those tags and added our id to hook into the list. The tag only lists your pages and since your home page often isn&#8217;t a WordPress page, but rather your index.php page, I&#8217;ve included a line of code to display the index.php page in the menu.</p>
<p>You&#8217;ll notice the added line also checks to see if the home page is the current page and if so it adds class=current_page_item. This class is used if you want to <a href="http://www.vanseodesign.com/blog/wordpress/hightlight-current-page-wordpress/">highlight the current page</a> or style it in some unique way. wp_list_pages() will automatically add that class to the links if creates and so it&#8217;s a good idea to add it to the home page link as well.</p>
<p>Let&#8217;s look more closely at the one remaining line of code above</p>
<pre class="css">
&lt;?php wp_list_pages(<span class="cssString">&#039;title_li=&amp;sort_column=menu_order&amp;depth=2&#039;</span>); ?&gt;
</pre>
<p>We&#8217;re passing three parameters to the wp_list_pages() tag. The first title_li is set to nothing, since we don&#8217;t want a title displayed. The second sort_column is set to menu order which will display our pages in the order we&#8217;ve specified through the admin side of WordPress. The last parameter depth is what actually creates our nested lists.</p>
<p>By default depth=1, which is why most menus in WordPress will only show our top level pages and not all your nested pages. By changing the depth to 2 WordPress will go one level deeper in producing our html and we&#8217;ll get a nested list, which we can style to be a drop-down. The code produced will look something like:</p>
<pre class="html">
<span class="htmlOtherTag">&lt;ul id=<span class="htmlAttributeValue">&quot;nav&quot;</span>&gt;</span>
  <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&#039;current_page_item&#039;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span>&gt;</span>Home<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
  <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-1&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;About&quot;</span>&gt;</span>About<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
    <span class="htmlOtherTag">&lt;ul&gt;</span>
      <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-3&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;Our Business&quot;</span>&gt;</span>Our Business<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
      <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-4&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;Our Staff&quot;</span>&gt;</span>Our Staff<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
    <span class="htmlOtherTag">&lt;/ul&gt;</span>
  <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-2&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;Contact Us&quot;</span>&gt;</span>Contact Us<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
<span class="htmlOtherTag">&lt;/ul&gt;</span>
</pre>
<p>The actual source of the links would be included and, of course, the menu items would be called whatever you named the pages. wp_list_pages also gives you two additional classes to hook into, page_item, and page_item-#. The important thing to note is that we now have a nested list.</p>
<p>You&#8217;re not limited to a depth of 2 either. If your pages go 3 levels deep you could have depth=3. You could go even deeper, though if you need more than 3 levels you probably need to rethink how you&#8217;ve organized your content.</p>
<h2>Dropdowns with wp_page_menu()</h2>
<p>As of WordPress 2.7 we now have the wp_page_menu() template tag, which produces essentially what we did above in a single line of code.</p>
<pre class="css">
&lt;?php wp_page_menu(<span class="cssString">&#039;title_li=&amp;sort_column=menu_order&amp;show_home=1&#039;</span>) ?&gt;
</pre>
<p>wp_page_menu() is actually a wrapper around wp_list_pages() so you can pass the same parameters as well as a few extras. One of those extras is show_home. By setting show_home to 1, we&#8217;re telling WordPress to include our home page in the menu. Setting it to 0 would tell WordPress to ignore the home page.</p>
<p>Here&#8217;s the html that gets created by the above:</p>
<pre class="html">
<span class="htmlOtherTag">&lt;div class=<span class="htmlAttributeValue">&quot;menu&quot;</span>&gt;</span>
  <span class="htmlOtherTag">&lt;ul&gt;</span>
    <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span>&gt;</span>Home<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
    <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-1&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;About&quot;</span>&gt;</span>About<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
      <span class="htmlOtherTag">&lt;ul&gt;</span>
        <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-3&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;Our Business&quot;</span>&gt;</span>Our Business<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
        <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-4&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;Our Staff&quot;</span>&gt;</span>Our Staff<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
      <span class="htmlOtherTag">&lt;/ul&gt;</span>
    <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;page_item page-item-2&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;&quot;</span> title=<span class="htmlAttributeValue">&quot;Contact Us&quot;</span>&gt;</span>Contact Us<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
  <span class="htmlOtherTag">&lt;/ul&gt;</span>
<span class="htmlOtherTag">&lt;/div&gt;</span>
</pre>
<p>The code is similar to what we were able to produce with wp_list_pages(), though not quite the same. You can still use it to style your dropdown, but the differences will determine which tag you prefer to use.</p>
<p>First notice that our hook (class=menu) is added to a wrapper div instead of the list itself. You can set the class name via the menu_class parameter and the fact that we&#8217;re using a class instead of an id doesn&#8217;t really affect anything. The wrapper div isn&#8217;t necessary, though it&#8217;s often used in coding drop downs. You may or may not want to include it, which would determine your choice in tags.</p>
<p>Ian Stewart has written a nice post on <a href="http://themeshaper.com/adding-class-wordpress-page-menu/">how to add a class or id to the list through a WordPress filter</a>.</p>
<p>The other major difference is that our home page doesn&#8217;t get the current_page_item class added. If you were hoping to use it to style the current page&#8217;s menu item then you may want to go with wp_list_pages() where you can add it as I did above.</p>
<p>You could also adapt Ian&#8217;s filter to add the current_page_item class. Justin Tadlock has also written a <a href="http://justintadlock.com/archives/2008/11/10/new-page-menu-function-in-wordpress-27">post on wp_page_menu</a>, including his own filter, as well as a post on <a href="http://justintadlock.com/archives/2009/04/15/how-to-widgetize-your-page-menu-in-wordpress">developing a widget for your page menu</a> using the wp_page_menu() tag</p>
<h2>Summary</h2>
<p>While I&#8217;ve spent a lot of time showing you how these two WordPress template tags work and the code they produce, it won&#8217;t take you a long time to get comfortable using them.</p>
<p>Give both a try and familiarize yourself with the codex pages for each so you can see the parameters you can use with them. Remember that any parameter you can use with <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages()</a> you can also use with <a href="http://codex.wordpress.org/Template_Tags/wp_page_menu">wp_page_menu()</a>. The latter then adds a few new parameters to the mix.</p>
<p>The next time you want a dropdown menu in your theme, don&#8217;t reach for a plugin or hard code your navigation. Just look to use either of these two template tags.</p>
<img src="http://www.vanseodesign.com/blog/?ak_action=api_record_view&id=728&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.vanseodesign.com/wordpress/how-to-create-a-dropdown-menu-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>79</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Page Templates Not Displaying In Dropdown</title>
		<link>http://www.vanseodesign.com/wordpress/wp-page-templates-dropdown/</link>
		<comments>http://www.vanseodesign.com/wordpress/wp-page-templates-dropdown/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 06:02:26 +0000</pubDate>
		<dc:creator>Steven Bradley</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=536</guid>
		<description><![CDATA[Last night while working on a WordPress theme I came across an odd bug with some custom page templates not showing up in the drop down menu when creating a new page. Sadly there wasn&#8217;t any information about it in the WordPress documentation or at the support forum. An hour or so of searching later [...]]]></description>
			<content:encoded><![CDATA[<p>Last night while working on a <a href="http://www.vanseodesign.com/design/wordpress.php">WordPress theme</a> I came across an odd bug with some custom page templates not showing up in the drop down menu when creating a new page. Sadly there wasn&#8217;t any information about it in the WordPress documentation or at the support forum. An hour or so of searching later and I did find a solution and thought I would post about what I found in case you or someone out there runs into a similar problem.<br />
<span id="more-536"></span></p>
<h2>Custom Page Template Problem</h2>
<p><img class="alignleft" src="http://www.vanseodesign.com/blog/images/wp-custom-page-template.png" alt="WordPress custom page template dropdown" /><br />
You may be aware that WordPress allows you to create your own page templates.</p>
<p>The default Kubrik theme comes with two, the archives template and the links template, but you can create as many as you&#8217;d like.</p>
<p>These templates will be available to you in a drop down when create a new WordPress page or when editing an existing page as you can see in the dropdown to the left.</p>
<p>WordPress 2.7 seems to have an odd bug where some of your custom page templates won&#8217;t show up in the drop down and unfortunately my theme had been bitten by that bug.</p>
<p>While I was able to see some of the custom templates others were not visible at all in the template drop down and so were unavailable for use.</p>
<h2>How To Get Your Custom Page Template To Show Up In The Drop Down</h2>
<p>A little searching directed me to <a href="http://www.zachgraeve.com/2009/01/14/wordpress-27-page-templates-not-working/">this post by Zach Graeve</a> with a very simple solution. The trick Zach describes is to temporarily switch to another theme and then reactivate your theme. Doing that seems to reset the theme, kind of like rebooting your computer.</p>
<p>After a few more searches it seems as through the solution above works for most everyone. Alas, I&#8217;m not like most everyone and the solution didn&#8217;t work for me. Hopefully if you encounter this bug it works for you, since it&#8217;s about as easy as it gets to fix.</p>
<p>Back to searching which led me to <a href="http://www.mkyong.com/blog/page-template-dropdown-missing-in-wordpress-25/">another post on the missing dropdowns, by mkyong</a>. The problem was the same and was occurring in version 2.5 of WordPress. The solution this time was going to the theme editor within the WordPress admin and select your page template to edit.</p>
<p>All custom page templates should start with the following code:</p>
<pre>
/*
Template Name: Custom Page Template Name
*/
</pre>
<p>which is a php comment that WordPress uses to identify page templates. In mkyong&#8217;s case and mine as well this bit of code was missing. What was particularly strange in my case was the code was in the file. That was the first thing I checked when I didn&#8217;t see the template listed in the drop down. Even stranger, I thought, was WordPress telling me I couldn&#8217;t save the file through the editor since the file didn&#8217;t have write permissions. Huh?</p>
<p>I checked permissions and indeed WordPress was right. How the permissions got that way is lost on me, but I set them back (755 for those of you who speak permissions) and I was able to add back in the php comment through the WordPress editor.</p>
<p>WordPress wouldn&#8217;t accept changes I made directly to the file in my usual code editor for whatever reason.</p>
<p>Once again all was right with the world or almost all right. WP still wouldn&#8217;t accept changes to the file through Coda, my editor of choice. When I opened things again tonight though, I seem to be able to make permanent changes in either editor and everything is indeed as it should be.</p>
<p>I realize most of you may never see this bug and perhaps stopped reading long ago, but this post is for the few of you who did encounter this problem and are having a hard time finding the solution. Hopefully you found this post and now know what to do.</p>
<img src="http://www.vanseodesign.com/blog/?ak_action=api_record_view&id=536&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.vanseodesign.com/wordpress/wp-page-templates-dropdown/feed/</wfw:commentRss>
		<slash:comments>78</slash:comments>
		</item>
		<item>
		<title>Do You Find The WordPress Next And Previous Post Links Useful?</title>
		<link>http://www.vanseodesign.com/wordpress/next-previous-posts/</link>
		<comments>http://www.vanseodesign.com/wordpress/next-previous-posts/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 19:19:46 +0000</pubDate>
		<dc:creator>Steven Bradley</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=534</guid>
		<description><![CDATA[By a show of hands or better yet a show of comments, do you find the next post and previous post navigation in WordPress useful? It&#8217;s there by default and many blogs including this one keep it, but how often do you actually click to see the next or previous post?

Just to make sure we&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>By a show of hands or better yet a show of comments, do you find the next post and previous post navigation in WordPress useful? It&#8217;s there by default and many blogs including this one keep it, but how often do you actually click to see the next or previous post?<br />
<span id="more-534"></span><br />
Just to make sure we&#8217;re talking about the same thing here&#8217;s an image of what I&#8217;m talking about with the two links circled:</p>
<p><img src="http://www.vanseodesign.com/blog/images/post-header.jpg" alt="Image of the typical post heading on this blog" /></p>
<p>Speaking for myself I&#8217;ve certainly clicked them on posts before, but I realize I don&#8217;t do it all that often and lately I&#8217;ve been removing them from many of the themes I&#8217;ve designed.</p>
<p>Because post titles can become quite long the links themselves can become quite long, which looks a bit messy to me. That&#8217;s easily fixed, but the main question is how useful you find the links.</p>
<p>If you don&#8217;t mind I&#8217;d appreciate a few thoughts. Leave a comment below. Thanks.</p>
<img src="http://www.vanseodesign.com/blog/?ak_action=api_record_view&id=534&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.vanseodesign.com/wordpress/next-previous-posts/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>How To Highlight The Current Page In WordPress</title>
		<link>http://www.vanseodesign.com/wordpress/hightlight-current-page-wordpress/</link>
		<comments>http://www.vanseodesign.com/wordpress/hightlight-current-page-wordpress/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 18:12:32 +0000</pubDate>
		<dc:creator>Steven Bradley</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.vanseodesign.com/blog/?p=519</guid>
		<description><![CDATA[One of the more common questions people ask about WordPress is how to highlight the current page in the main navigation. It&#8217;s a nice effect that aids usability by giving your visitors a cue as to where they are within your site. It&#8217;s also surprisingly easy to achieve.

Highlight Your WordPress Page Links
Many themes are designed [...]]]></description>
			<content:encoded><![CDATA[<p>One of the more common questions people ask about WordPress is how to highlight the current page in the main navigation. It&#8217;s a nice effect that aids usability by giving your visitors a cue as to where they are within your site. It&#8217;s also surprisingly easy to achieve.<br />
<span id="more-519"></span></p>
<h2>Highlight Your WordPress Page Links</h2>
<p>Many themes are designed with a <a href="http://www.vanseodesign.com/blog/css/simple-navigation-bar-with-css-and-xhtml/">simple html and css navigation bar</a> that displays your home page and a list of your WordPress pages. It might look something like the following:</p>
<ul id="list-nav">
<li><a href="#">Home</a></li>
<li class="current"><a href="#">About Us</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Contact</a></li>
</ul>
<p style="padding-top:50px">
In the above navigation bar each of the links would be a WordPress page with the exception of Home, which would be a link back to your blog&#8217;s home page. You can see how About Us is styled differently to indicate it&#8217;s the page your visitor is currently viewing. The code WordPress uses to display the html for the above is:
</p>
<pre class="css">
&lt;ul&gt;
 &lt;li&gt;&lt;a href=<span class="cssString">"&lt;?php echo get_option(<span class="cssString">&#039;home&#039;</span>); ?&gt;"</span>&gt;Home&lt;/a&gt;&lt;/li&gt;
 &lt;?php wp_list_pages(<span class="cssString">&#039;title_li=&#039;</span>); ?&gt;
&lt;/ul&gt;
</pre>
<p>The code above is taken directly from the WordPress default theme, but it&#8217;s very typical of free and premium themes as well. The code in the list-item provides a link to your blog&#8217;s home page and the following line of code uses a <a href="http://codex.wordpress.org/Template_Tags/">WordPress template tag</a> to run through all your WordPress pages and wrap them in html list-item and link code.</p>
<p>The html that us ultimately produced will look like the following code block. Note that I&#8217;ve replaced the actual URL each link would point to with a # for simplicity.</p>
<pre class="html">
<span class="htmlOtherTag">&lt;ul&gt;</span>
 <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;#&quot;</span>&gt;</span>Home<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
 <span class="htmlOtherTag">&lt;li class=<span class="htmlAttributeValue">&quot;current_page_item&quot;</span>&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;#&quot;</span>&gt;</span>About Us<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
 <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;#&quot;</span>&gt;</span>Services<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
 <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;#&quot;</span>&gt;</span>Products<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
 <span class="htmlOtherTag">&lt;li&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;#&quot;</span>&gt;</span>Contact<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/li&gt;</span>
<span class="htmlOtherTag">&lt;/ul&gt;</span>
</pre>
<p>The key to the above code is the class=&#8221;current_page_item&#8221; which WordPress automatically adds through the <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages</a> template tag. When your viewing the About Us page the class will be applied to the list-item containing a link to the About Us page. When you&#8217;re viewing the Contact page the class will be applied to the list-item for the Contact link.</p>
<p>Given this class will only appear on the currently viewed page all you need to do highlight the page is give the current_page_item class a look that makes it stand out. How you highlight the current page link is up to you and will depend on the style of your theme, but a simple way to highlight the link is to give it a different background-color and a different color for the text itself.</p>
<h2>Highlighting Your Main Blog Page</h2>
<p>Everything above works great for highlighting the link in your navigation when you&#8217;re viewing a page, but what about when you&#8217;re on your blog&#8217;s home page? The home page link wasn&#8217;t being produced with the wp_list_pages tag and won&#8217;t automatically have our class applied. We need to find a way to have the class added when you&#8217;re viewing the home page.</p>
<p>Fortunately WordPress makes this easy through the use of <a href="http://codex.wordpress.org/Conditional_Tags">conditional tags</a>. Combined with a little bit of php we can apply the class just as above. The conditional tag used to check if the current page is your main blog page is called is_home() and the code you would use to add the current_page_item class can be seen below.</p>
<p><strong>Note:</strong> If you&#8217;ve set WordPress to use a static front page as your home page you&#8217;ll want to use the is_front_page() conditional to test the true home page of your site. is_home() tests to see if the page is your main blog page. See Andrew&#8217;s comment below.</p>
<pre class="css">
&lt;ul&gt;
 &lt;li&lt;?php if ( is_home() ) { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"&lt;?php echo get_option(<span class="cssString">&#039;home&#039;</span>)&#59; ?&gt;"</span>&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;?php wp_list_pages(<span class="cssString">&#039;depth=1&amp;title_li&#039;</span>); ?&gt;
&lt;/ul&gt;
</pre>
<p>The code we&#8217;re concerned with is:</p>
<pre class="css">
&lt;?php if ( is_home() ) { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;
</pre>
<p>All the code above is doing is checking to see if we&#8217;re viewing the main page of the blog and if so add the current_page_item class to the list-item. The css in place for the pages will do the rest. Pretty simple.</p>
<h2>Highlight Blog Posts And Other Blog Pages</h2>
<p>Of course your blog has more pages than just the main page. You have post pages, search pages, and archive pages. Your main navigation likely won&#8217;t include all these pages, and the code we&#8217;ve been using here doesn&#8217;t so we&#8217;ll highlight the home page whenever we&#8217;re viewing one of these other pages.</p>
<p>All we need to do is add a few more conditional_tags to our Home link</p>
<pre class="css">
&lt;ul&gt;
 &lt;li&lt;?php if ( is_home() || is_single() || is_search() || is_archive() ) { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"&lt;?php echo get_option(<span class="cssString">&#039;home&#039;</span>); ?&gt;"</span>&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;?php wp_list_pages(<span class="cssString">&#039;depth=1&amp;title_li&#039;</span>); ?&gt;
&lt;/ul&gt;
</pre>
<p>is_single tests to see if we&#8217;re on a single post page, and is_search and is_archive test to see if we&#8217;re viewing any of the search or archive pages as you&#8217;d expect. The double pipe || is php to say or. So the statement is testing if we&#8217;re on the main blog page or a single post page or a search page or an archive page and if we&#8217;re viewing any of those pages add the current_page_item class. Our css will handle the highlighting as it has above.</p>
<p>Nothing too hard right?</p>
<h2>What If Your Navigation Isn&#8217;t Using The WordPress wp_list_pages Tag?</h2>
<p>Occasionally you&#8217;ll come across a theme that doesn&#8217;t use wp_list_pages to create the main navigation. Maybe your blog uses a lot of WordPress pages, but you only wanted a few to show in the navigation. Your developer may have decided to hard code the html instead of using the WordPress tag.</p>
<p>One more time WordPress to the rescue. Even if your theme doesn&#8217;t take advantage of wp_list_pages to automatically add the class you can add it in same manner we added it to the main blog page, that is with a conditional tag. This time we&#8217;ll use is_page() and specify exactly which page we want to test for.</p>
<p>You can test for a specific page if you know it&#8217;s WordPress id. Say your About Us page us id 9. You&#8217;d write the conditional as:</p>
<pre class="css">
is_page(<span class="cssString">&#039;9&#039;</span>)
</pre>
<p>What&#8217;s that? You don&#8217;t know the idea of your page? That&#8217;s ok. You can also check for it&#8217;s permalink. Your About Us page will likely be called about-us and you could use it in the conditional like the following:</p>
<pre class="css">
is_page(<span class="cssString">&#039;about-us&#039;</span>)
</pre>
<p>Putting it all together your hard coded navigation might look like:</p>
<pre class="css">
&lt;ul&gt;
 &lt;li&lt;?php if ( is_home() || is_single() || is_search() || is_archive() ) { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"&lt;?php echo get_option(<span class="cssString">&#039;home&#039;</span>)&#59; ?&gt;"</span>&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&lt;?php if ( is_page(<span class="cssString">&#039;about-us&#039;</span>)) { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"#"</span>&gt;About Us&lt;/a&gt;&lt;/li&gt;
 &lt;li&lt;?php if ( is_page(<span class="cssString">&#039;services&#039;</span>)) { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"#"</span>&gt;Services&lt;/a&gt;&lt;/li&gt;
 &lt;li&lt;?php if ( is_page(<span class="cssString">&#039;products&#039;</span>)) { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"#"</span>&gt;Products&lt;/a&gt;&lt;/li&gt;
 &lt;li&lt;?php if ( is_page(<span class="cssString">&#039;contact&#039;</span>))  { echo <span class="cssString">&#039; class=<span class="cssString">"current_page_item"</span>&#039;</span>&#59 <span class="cssMedia">}</span> ?&gt;&gt;&lt;a href=<span class="cssString">"#"</span>&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>As long as your css is in order and you&#8217;ve styled .current_page_item in a way to highlight it, your blog should be all set to highlight the current page.</p>
<img src="http://www.vanseodesign.com/blog/?ak_action=api_record_view&id=519&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.vanseodesign.com/wordpress/hightlight-current-page-wordpress/feed/</wfw:commentRss>
		<slash:comments>82</slash:comments>
		</item>
	</channel>
</rss>

