繁体   English   中英

在标题中显示页面标题-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> <h1><?php bloginfo('name'); ?></h1>

您将要使用您的

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM