Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

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(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title>
<?php
    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 ) );
  ?>
</title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
    <header id="masthead" class="site-header" role="banner">


  <!-- YOUR CUSTOM LINK HERE: -->
  <a href="http://lifestyle-site.com/">Switch to Lifestyle Site</a>    


        <hgroup>
            <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>
      </h1>
            <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
        </hgroup>

        <nav role="navigation" class="site-navigation main-navigation">
            <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
        </nav>
    </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>
  </div>
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
add comment

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
add comment

Your Answer

 
discard

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.