您应该在提出此类问题时提供代码。下面是标题的示例。php文件。查看代码并了解它是如何完成的:
<!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">
添加链接的部分是:
<a href="http://lifestyle-site.com/">Switch to Lifestyle Site</a>
您还可以将其包装在div标记中,以实现更多css控制:
<div id="custom-link">
<a href="http://lifestyle-site.com/">Switch to Lifestyle Site</a>
</div>