我想以网页标题为中心的网站,特别是对登录页。
如果不将帖子标题和网站上的其他内容放在中心位置,这是可能的吗?
我想以网页标题为中心的网站,特别是对登录页。
如果不将帖子标题和网站上的其他内容放在中心位置,这是可能的吗?
也许是这样的
$the_post_type = get_post_type( $post->ID );
switch ( $the_post_type ) {
case \'page\':
// you\'ll need something else to distinguish "landing" pages from normal ones
// which would allow you to then set a flag for it
if ( $some_condition ) $landing_page = true;
if ( $landing_page) {
// display your title with the class that\'ll centre it
}
break;
case \'post\':
case default:
// display your title with the normal class
}
你可以把它放在你的主题风格中。css
h1.page-title {
text-align: center;
}
然后确保在主题页面中。php您有一个h1标记实例,上面有一个“页面标题”类。例如:<h1 class="page-title"><?php the_title(); ?></h1>
你将如何解决这个问题?在一个贴子页面(single.php)上,我需要呼应出导致它的分类法的名称。因此,如果我浏览某个分类法中的帖子列表并单击某个帖子,我需要在该帖子页面(single.php)上显示之前查看过的分类法名称,这将导致出现帖子页面。分类相册。php分类法歌曲。php仅有一个的php有没有办法不使用GET、POST或COOKIE方法?