• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 469
  • Last Modified:

Click Tab Navigation in Wordpress K2 Theme, go to different URL

In Wordpress (K2 theme), it adds a navigation based on the Pages you add on your site.  I would like the tabs to click to a different URl.


Home   Services   About Us

I would like all of the tabs to click to different URls outside of my blog, in the same window.

Using Wordpress 2.3 final, K2 RC 2.
  • 2
1 Solution
You could achieve this using javascript redirects

<script type="text/javascript">
window.location = "http://www.xyz.com/services.html"

Add the above mentioned code to all the pages you would like to link to external links and change the location accordingly.

Note: Add this to the code and not the WYSIWIG editor available in Wordpress.

Hope this helps.

jazzviolinAuthor Commented:
I'd rather not use javascript redirects.  Is there a way to modify the <div> tag (sort of like how you modify a <div> for the header, if you want it to be clickable)?
yeah, piece of cake:

<div onclick="window.location='http://www.google.com'" style="cursor:pointer">Link To Google</div>

That'll also change the cursor when the mouse is hovering over it, so users will be able to tell it's a link.
Alright, go to your Presentation tab inside your admin panel, and then click the Theme editor. You should see a file labeled "header.php". Click that to edit. At the very bottom of that file, you ought to see something like this:

<ul id="menu">
    <li <?php if(is_home()){echo 'class="current_page_item"';}?>><a href="<?php bloginfo('siteurl'); ?>" title="Home">Home</a></li>
        <?php wp_list_pages('title_li=&depth=1');?>
    <li class="feed"><a title="RSS Feed of Posts" href="<?php bloginfo('rss2_url'); ?>">RSS Feed</a></li>

To add your custom offsite links, just add:
<li><a href="http://www.google.com">Google</a></li>

Place that line (as many as you need) right after  "Home</a></li>" or right after "<?php wp_list_pages('title_li=&depth=1');?>".

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now