Create a WordPress Page Tab that leads to a non WordPress URL

Written by James McDonald

October 26, 2009

I have my WordPress setup to display all the blog posts on the front page and the WordPress “Pages” as tabs on the navigation at the top of the page.

However I also would like the navigation to point to other non WordPress areas of my domain and go straight there. For example my Gallery2 Gallery or a long URL somewhere else:

You have several options of adding tabs and getting them to redirect to non – WordPress parts of your site:
A wordpress plugin that does the job
http://txfx.net/wordpress-plugins/page-links-to/

The Header.php Hack Method
Edit the template you are using and change the PHP code to add another navigation element which will appear as a tab. The problem with this approach is some WordPress templates have a mix of PHP, jQuery and CSS making up the navigation tabs so it becomes confusing as to what to add to the template to get yourself a new tab. Not only can it be confusing you also lose your tabs when you change templates. Read on for a solution:

Note: The following works on sites which use Apache web server and have .htaccess and mod_rewrite working.

WordPress Page with the Permalink Pointing to a Top Level Web Directory
If you have a gallery located at http://yourdomain.com/gallery it’s simple
Firstly Create a new blank page with a title and edit the permalink to simply be /gallery as shown here:
When you click the “Gallery” tab it will take you directly to the /gallery URL

WordPress Page with a Unique Permalink using .htaccess to Redirect to a Complicated URL
If you have a more complex URL you want to redirect to such as http://yourdomain/gallery/v/house_progress. You then need one more thing to get it working.
Again you create a new blank WordPress Page with a unique arbritrary permalink:

Then you need to edit your .htacess file (I will let you discover the location of this on your web site) and put a Redirect in. In the example I am using the WordPress page permalink points to /renos and that redirects to the /gallery/v/house_progress URL. Of course you could redirect to an external URL too.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
Redirect 301 /renos /gallery/v/house_progress
# you can also use something like
# Redirect 301 /mypermalink http://anotherdomain.com/pathtocontent/mypage.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress

This list is just other ways of saying the title of this blog.

  • WordPress Page Tab Leading to External Weblink
  • Navigation Page Navigation Tabs pointing to External Pages
  • Create a wordpress page to an external resource or URL
  • Embed an external link in your wordpress page tabs
  • Create links to external content on the WordPress Page Tab Navigation without editing the template

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Adding BCC to Divi Contact Form

The Divi contact form allows you to send to multiple email addresses by opening the properties of the form and...