在header - Wordpress中显示页面标题


Display the page title in header - Wordpress

我需要为标题图像添加适当的站点标题。

我需要的是添加页面标题,标题图像在正常页面,而在首页将没有页面标题显示(因为有SVG标志代替)。下面是我从"content-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 -->

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

你要用你的

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

有条件地在主页上显示徽标,在所有其他页面上显示其他内容