WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building site (dummy site is up at www.teamcoding.ca/corporate) and would like to include in the upper-right hand part of the screen, "Switch to Lifestyle Site" with a link to a different site.

My impression is that to do this I need to edit one of my .php files.

I tried to edit page.php, full-width-page.php (the template I'm using), but did not see any results. I also tried editing header.php but did not see any results.

Any help would be greatly appreciated.

share|improve this question
up vote 1 down vote accepted

You should provide your code when asking this type of question. Here is an example of a header.php file. Look at the code and see how it's done:

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
    global $page, $paged;
    wp_title( '|', true, 'right' );
    bloginfo( 'name' );
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
    echo " | $site_description";
    if ( $paged >= 2 || $page >= 2 )
    echo ' | ' . sprintf( __( 'Page %s', '_s' ), max( $paged, $page ) );
<?php wp_head(); ?>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
    <header id="masthead" class="site-header" role="banner">

  <a href="http://lifestyle-site.com/">Switch to Lifestyle Site</a>    

            <h1 class="site-title">
        <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
            <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>

        <nav role="navigation" class="site-navigation main-navigation">
            <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    </header><!-- #masthead .site-header -->
<div id="main">

The part that adds the link is:

  <a href="http://lifestyle-site.com/">Switch to Lifestyle Site</a>

You can also wrap it in a div tag for more css control:

  <div id="custom-link">
  <a href="http://lifestyle-site.com/">Switch to Lifestyle Site</a>
share|improve this answer
Thanks for the help. You were exactly right. And for future reference, I'll be sure to post my code in questions like this. – mcranston18 May 30 '12 at 13:06

You should put that link on your header.php. At default condition of a theme, header.php should called on every page template.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.