underline
phone number

A creative, friendly web design company based in Chelmsford, Essex

back light

How to Link to Home Page & Category Pages in WordPress Menu

When you need a CMS database-driven site that clients can update themselves – an editable site – you have several choices out there; I prefer to use WordPress. But being able to customise a template to exact client specifications is hard ad you take a risk with the limitations of each template. So why not design your own?

Well, it’s not going to be a simple HTML/CSS standard website design of course, there are hundreds of files in a WordPress theme to deal with and problems can be a nightmare to resolve. Bit it’s worth it in the end. One of the basics to master is being able to create your own WordPress menu so that you can have full control and create your own menu. WordPress allows you to create menus of course, but it’s nice to have full control over your menu links depending on how you add your pages to your site. You can contact us at Fizz Web Design Chelmsford about us designing your own WordPress-based website too of course.

linking pages in wordpress menu

How to Link to Home Page in WordPress

You are probable used to using something along the lines of the following:

Select Code
1
<a id="home" title="Home" href="index.html">Home </a>

But assuming you have set up a specific WordPress ‘Home’ page, then this won’t really work, so use the following:

Select Code
1
<a href="<?php echo get_settings('home'); ?>">Home</a>

How to Link to Category Pages in WordPress

Each category page in WordPress has it’s own unique identifier and this is what you need to find before you can link to each individual category in a menu. Going into your WordPress admin area and clicking on ‘Categories’ and then the particular category you want will give you something like this in the URL bar (address bar).

Select Code
1
http://www.yoursite.com./blog/wp-admin/edit-tags.php?action=edit&amp;taxonomy=category&amp;tag_ID=58&amp;post_type=post

In this made up example you see that the ID code is 58, so the menu link to make this category a ‘page link’ is going to be something like this:

Select Code
1
<a href="../index.php?cat=2">Commercial</a>

What you are effectively doing is creating a menu link that will treat each WordPress category as a separate page.

(The ‘../’ part at the beginning of this link is taking the menu link back to the root folder, depending on how you have things set up, you may or may not need this – experiment!)

How to Link to Contact Page in WordPress

Now if you have used a plugin to create a ‘contact us’ page (and I’d highly recommend doing this rather than trying to create your own – something like Contact Form 7 is very popular) then your WordPress menu link to your contact us page will be like this if you have called your contact page ‘contact’:

Select Code
1
<a href="contact">Contact Us</a>

How to Link to Pages in WordPress Menu

You will probably also create pages within WordPress using the ‘Pages’ link on the right, these are linked in a similar way to your contact form. Here I have created a page called ‘delivery’ and will link it in my WordPress menu like this:

Select Code
1
<a href="delivery">Delivery Options</a>

All quite simple really once you know! You can find more out about working with and customising WordPress at Getting Started With WordPress.

Share this..
Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInPin on PinterestEmail this to someoneShare on TumblrShare on StumbleUponShare on Reddit

Tags: , , , , , , ,


One Response to “How to Link to Home Page & Category Pages in WordPress Menu”

  1. Chris Potter says:

    Really nice post.. It is useful for the wordpress lovers..

Leave a Reply

Please complete the sum so we know you\'re a human... *