在页眉中显示页面标题 - Wordpress

     2023-03-06     189

关键词:

【中文标题】在页眉中显示页面标题 - Wordpress【英文标题】:Display the page title in header - Wordpress 【发布时间】:2016-01-06 15:17:03 【问题描述】:

我需要为标题图片添加标题,或者更确切地说添加适当的网站标题。

我需要在普通页面的标题图像中添加页面标题,而在首页不会显示页面标题(因为有 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 -->

【问题讨论】:

【参考方案1】:

你可以使用 &lt;h1&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/h1&gt;

【讨论】:

【参考方案2】:

你会想要使用你的

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

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

【讨论】:

在 Elementor 中删除页眉和页脚

...:我想在Elementor中使用空白页面开始设计,但无法删除由Wordpress主题定义的页眉和页脚。正如您在屏幕截图中看到的那样,我已经选择了“Elementor画布”选项。尽管如此,页面仍然显示来自另一个主题的侧边栏、页眉和页脚。提... 查看详情

如何将 wordpress 博客与网站页眉和页脚设计集成到 php 网站博客页面?

】如何将wordpress博客与网站页眉和页脚设计集成到php网站博客页面?【英文标题】:Howtointegratewordpressblogtophpwebsiteblogpagewithsiteheaderandfooterdesign?【发布时间】:2015-12-1108:55:57【问题描述】:我想在不使用的情况下将wordpress博客显... 查看详情

如何在wordpress主题中注册html页面的Css

】如何在wordpress主题中注册html页面的Css【英文标题】:HowtoregisterCssofhtmlpageinwordpresstheme【发布时间】:2016-12-1503:08:17【问题描述】:我是wordpress开发的新手。我试图将响应式html页面转换为wordpress主题,但html页面的CSS在wordpress主... 查看详情

如何在将放置在页眉区域的块中显示页面上显示的数据?

】如何在将放置在页眉区域的块中显示页面上显示的数据?【英文标题】:Howtodisplaythedatadisplayedonthepageintheblockthatwillbeplacedintheheaderregion?【发布时间】:2022-01-1107:47:05【问题描述】:我制作了一个自定义模块来执行此操作:当用... 查看详情

如何在其他 wordpress 网站中调用页眉和页脚?

】如何在其他wordpress网站中调用页眉和页脚?【英文标题】:howtocallheaderandfooterinotherwordpresswebsite?【发布时间】:2017-09-0811:30:01【问题描述】:我有两个wordpress网站,第一个我们可以称之为网站第一个网站,第二个网站,我们可... 查看详情

类别页面空白,但商店在 WordPress 上的 WooCommerce 上工作

】类别页面空白,但商店在WordPress上的WooCommerce上工作【英文标题】:Categorypagesblank,butshopworksonWooCommerceonWordPress【发布时间】:2021-11-1408:28:09【问题描述】:在某些时候,我们不知道类别页面何时停止显示页面页眉/页脚以外的... 查看详情

在wordpress页面的选择标签中显示查询结果?

】在wordpress页面的选择标签中显示查询结果?【英文标题】:DisplayResultsfromqueryinaselecttaginwordpresspage?【发布时间】:2016-07-1707:52:34【问题描述】:我有一个WordPress页面,它使用以下代码从WordPress连接到外部数据库:$my_wpdb=newwpdb(\... 查看详情

在 Wordpress 中显示存档帖子

】在Wordpress中显示存档帖子【英文标题】:DisplayarchivepostsinWordpress【发布时间】:2010-06-0708:00:34【问题描述】:我希望将档案页面显示为普通的帖子页面...因此,带有二级导航的帖子页面显示:最新帖子/上个月/去年/旧在每个页... 查看详情

在类别页面 Wordpress 中显示帖子列表

】在类别页面Wordpress中显示帖子列表【英文标题】:ShowalistofpostsincategorypageWordpress【发布时间】:2021-12-2217:37:17【问题描述】:所以基本上我正在尝试显示类别页面的帖子列表。我需要动态地做,所以每个类别页面都有自己的帖... 查看详情

在 wordpress 的自定义页面模板中显示帖子分类信息

】在wordpress的自定义页面模板中显示帖子分类信息【英文标题】:Showposttaxonomyinformationincustompagetemplateinwordpress【发布时间】:2017-11-2510:08:41【问题描述】:我有一个正在通过子主题编辑的主题。我已经能够创建自定义页面模板... 查看详情

如何在子类别页面中显示 Wordpress 类别?

】如何在子类别页面中显示Wordpress类别?【英文标题】:HowtodisplayWordpressCategoriesinSub-CategoriesPage?【发布时间】:2014-11-2419:35:32【问题描述】:好的,让我先告诉你我的目标,然后你可以看看下面的例子,这会更有意义。可以这... 查看详情

Wordpress:如何通过自定义分类法在作者页面中显示帖子计数

】Wordpress:如何通过自定义分类法在作者页面中显示帖子计数【英文标题】:Wordpress:Howtodisplaypostcountinauthorpagebycustomtaxonomy【发布时间】:2015-09-1420:37:51【问题描述】:我正在尝试使用计数器在作者页面中显示自定义分类,但似... 查看详情

无法在主页以外的其他页面中显示图像(wordpress/html/css)

】无法在主页以外的其他页面中显示图像(wordpress/html/css)【英文标题】:TroubleshowingimagesinotherpagesthanHome(wordpress/html/css)【发布时间】:2012-11-2901:59:44【问题描述】:您好,我有一个为客户做的小网站,我使用了一个html/css网站... 查看详情

在 Wordpress 页面的下拉列表中显示数据库 mySQL 中的数据

】在Wordpress页面的下拉列表中显示数据库mySQL中的数据【英文标题】:displaydatafromdatabasemySQLinadropdownlistinaWordpresspage【发布时间】:2017-09-1903:13:33【问题描述】:我是PHP初学者,我想在Wordpress页面的下拉列表中显示数据库MySQL中的... 查看详情

在 Wordpress 的 Archive、Feeds 页面中突出显示 current-cat

】在Wordpress的Archive、Feeds页面中突出显示current-cat【英文标题】:Highlightingcurrent-catintheArchive,FeedspageofWordpress【发布时间】:2011-09-1321:04:40【问题描述】:我需要在我的帖子页面中列出一个类别列表,并且我希望突出显示当前类... 查看详情

获取带有静态 html 内容的 wordpress 页面模板以在搜索中显示

】获取带有静态html内容的wordpress页面模板以在搜索中显示【英文标题】:Gettingwordpresspagetemplatewithstatichtmlcontenttoshowinsearches【发布时间】:2020-01-2818:25:41【问题描述】:我已经设置了一个带有静态HTML的Wordpress页面模板(通过在... 查看详情

在 WordPress 中更新自定义 PageLine 的部分时的操作挂钩

】在WordPress中更新自定义PageLine的部分时的操作挂钩【英文标题】:ActionHookForWhenACustomPageLine\'sSectionIsUpdatedinWordPress【发布时间】:2012-10-1219:10:24【问题描述】:我正在尝试编写一个自定义函数,以便在页眉或页脚区域的内容更... 查看详情

Wordpress - 使用类型为日期的自定义字段在 Elementor 页面中显示帖子

】Wordpress-使用类型为日期的自定义字段在Elementor页面中显示帖子【英文标题】:Wordpress-displaypostsinElementorpageusingcustomfieldwheretypeisdate【发布时间】:2021-01-2803:59:29【问题描述】:我尝试实现这一点,同时尝试应用从这里和那里获... 查看详情