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

Posted on 2007-10-02
Last Modified: 2008-01-09
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.
Question by:jazzviolin
    LVL 6

    Expert Comment

    You could achieve this using javascript redirects

    <script type="text/javascript">
    window.location = ""

    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.


    Author Comment

    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)?
    LVL 13

    Expert Comment

    yeah, piece of cake:

    <div onclick="window.location=''" 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.
    LVL 13

    Accepted Solution

    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="">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');?>".

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
    Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
    The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be Log into your Hosting account. IPage will be used for demonstration : Locat…
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now