简体   繁体   English

WordPress:要在除首页/首页之外的所有页面顶部显示内容标题

[英]Wordpress : want to display content title on the top of all pages except on front page/home page

Right now i am here, 现在我在这里 在此处输入图片说明 As you see in this snap title contact us , i want to fix this title as itis in same position, but i am trying to display this on all page of my site except home page. 如您在此快照标题中看到的,请与我们联系 ,我想将此标题固定为itis,但我想将其显示在我网站的除首页之外的所有页面上。

code is here : 代码在这里:

<header class="entry-header">
<h1 class="cg-page-title"><?php the_title(); ?></h1>
</header>

i have tried like this to display : 我试图这样显示:

<header class="entry-header">
<?php
if ( function_exists( 'cg-page-title' ) && (!is_front_page() ) ) {
cg-page-title( '<h1 class="cg-page-title"> the_title();','</h1>' );
}
?>
</header>

But, it doesn't work. 但是,它不起作用。

Maybe try : 也许尝试:

<header class="entry-header">
    <?php if( !is_home() && !is_front_page() ): ?>
        <h1 class="cg-page-title"><?php the_title(); ?></h1>
    <?php endif; ?>
</header>

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

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