2015-10-08 106 views
0

我需要标题,或者将正确的网站标题添加到标题图像。显示标题中的页面标题 - Wordpress

我需要的是将页面标题添加到常规页面中的页眉图像,而在页面中不会显示页面标题(因为有SVG徽标)。下面是我的代码从“内容的header.php”了:

// Display the image and text 
    ?> 
    <header class="content-header-image"> 
     <div class="<?php echo $image_class; ?>" style="background-image: url('<?php echo $image_url; ?>')"> 
      <div class="<?php echo $overlay_class; ?>"> 
      <h1 class="header-image-title"><?php echo $title; ?></h1> 
      <?php if ($subtitle) echo '<h2 class="header-image-caption">' . $subtitle . '</h2>'; ?> 
      <?php if ($description) echo '<p class="header-image-description">' . $description . '</p>'; ?> 

      <?php    
      // Only for static home page, show a scroll down icon 
      if (is_front_page()) { 
       echo '<div class="spacer"></div>'; 
       echo '<a href="#pagetop" class="scroll-down smoothscroll"><span class="glyphicon glyphicon-chevron-down"></span></a>'; 
      } 
      ?> 

      </div><!-- .cover-image-overlay or .section-image-overlay --> 
     </div><!-- .cover-image or .section-image --> 
    </header><!-- content-header-image --> 

回答

1

您可以使用 <h1><?php bloginfo('name'); ?></h1>

0

你会想用你的

if(is_front_page()){ what you have } 
     else{ echo 'other content for other pages';} 

有条件上显示的标志所有其他页面上的主页和其他内容