我正在使用“Revusion - Flat Corporate Wordpress Theme”,有一个默认设置,当您添加页面标题时,它会被分配H1状态并在主题的media.css文件中分配CSS。
#pagetitle-container h1, #pagetitle-container h3 {
font-size:30px;
font-family:'Raleway', Helvetica, Arial;
font-weight:300;
text-transform:uppercase;
color:#fff;
position:relative;
margin:0px 0px -30px 0px;
bottom:2px;
}
问题是您可能知道谷歌搜索引擎优化和分析我被命令每页只有一个H1标签。我希望这个页面标题标题不会是H1,因为我有自己的H1我想在页面上使用,例如在身体中。
所以PHP,我认为这样做是在下面。我怎么能改变它,例如页面标题是H6。它不能像改变h1那样简单 - > H6? 简而言之,我只想要页面上的一个h1,例如你可以在wordpress中使用“可视化编辑器”进行设置。
<!-- pagetitle start here -->
<section id="pagetitle-container" <?php if($bg) echo'style="background:'.$bg.'"'; ?>>
<div class="row">
<?php if($page_breadcrumb_onoff==1){?>
<div class="five column breadcrumb">
<?php if(function_exists('bcn_display')){?>
<?php
echo '<ul>';
bcn_display_list();
echo '</ul>';
?>
<?php }else{ ?>
<ul><?php if (function_exists('indonez_breadcrumbs')) indonez_breadcrumbs(); ?></ul>
<?php }?>
</div>
<?php } ?>
<div class="<?php if($page_breadcrumb_onoff==1){echo 'seven';}else{echo 'twelve';} ?> column pagetitle">
<?php
if(is_singular('portfolio') || is_singular('team') || is_singular('client')) :
echo '<h1>'.get_the_title().'</h1>';
elseif(is_attachment()):
echo '<h1>'.get_the_title().'</h1>';
elseif(is_single() || is_home()) :
echo '<h1>'.$blog_title.'</h1>';
elseif(is_archive()):
echo '<h3>';
if ( is_day() ) :
printf( __( '<span>%s</span>', 'indonez' ), get_the_date() );
elseif ( is_month() ) :
printf( __( '<span>%s</span>', 'indonez' ), get_the_date('F Y') );
elseif ( is_year() ) :
printf( __( '<span>%s</span>', 'indonez' ), get_the_date('Y') );
elseif ( is_author()) :
printf( __( 'Archives %s', 'indonez' ), "<a class='url fn n' href='" . get_author_posts_url( get_the_author_meta( 'ID' ) ) . "' title='" . esc_attr( get_the_author() ) . "' rel='me'>" . get_the_author() . "</a>" );
elseif ( is_search()) :
printf( __( 'Search Results', 'indonez' ), '<span></span>' );
else :
printf( __( '%s', 'indonez' ), '<span>' . single_cat_title( '', false ) . '</span>' );
endif;
echo '</h3>';
elseif(is_search()):
echo ' <h1>';
printf( __( 'Search Result', 'indonez' ), '<span>' . get_search_query() . '</span>' );
echo '</h1>';
elseif(is_404()):
echo ' <h1>'.__( 'ERROR 404', 'indonez' ).'</h1>';
endif;
?>
</div>
</div>
</section>
<!-- pagetitle end here -->
好的,所以我在'theme-functions.php'文件中也找到了这段代码。 如果它没用,我真的很抱歉,因为我没有强大的力量 PHP的知识,它可能会或可能没有帮助
$custom_css .= '#mainmenu ul, #menu li ul a,#menu li ul a:visited, #pagetitle-container h1, #pagetitle-container h3, .pageof, .wp-pagenavi .pages, .wp-pagenavi .extend, .pages a, .pages .current, .wp-pagenavi a, .wp-pagenavi .current, a.comment-reply-link, a.comment-reply-link:visited, #cancel-comment-reply-link, .tag-cloud, .grey-column.custom_bg h1, .grey-column.custom_bg h2, .grey-column.custom_bg h3, .grey-column.custom_bg h4, .grey-column.custom_bg h5, .grey-column.custom_bg h6
{font-family:'.$font1.', Helvetica, Arial}'."\n";
$custom_css .= 'h1,h2,h3,h4,h5,h6, .circle-border p, table th, .testi-name{font-family:'.$font2.', Helvetica, Arial}'."\n";
$custom_css .= 'a:link,a:visited,a:active, ul.tabs li.active a, ul.tabs-left li.active a, ul.tabs-right li.active a, ul.tabs-bottom li.active a, .breadcrumb ul li.current-page, #pf-filter ul li a:hover, #pf-filter ul li a:active, #pf-filter ul li a.selected, .post-info ul li a:hover, ul.popular-list li p.comment-count a, ul.popular-list li p.comment-count a:visited, .text-info{color:'.$generalcolor.'}'."\n";
$custom_css .= '.post-type, aside .widget-title, .sitemap-heading h4, .rdm, .widget_search button, #searchform button, .widget_search button:hover, #searchform button:hover, .highlight, .circle-border:hover, .pages a, .wp-pagenavi a, .wp-pagenavi .pages, .teaser:hover .teaser-preview-box, .teaser:hover .teaser-gallery-box, button[type="submit"], input[type="submit"], input[type="button"]{background:'.$generalcolor.'}'."\n";
if($generalcolor!=""){
$custom_css .='.rdm:hover, button[type="submit"]:hover, input[type="submit"]:hover, input[type="button"]:hover{background:'.$buttonhover.'}'."\n";
}
if($generalcolor!=""){
$custom_css .= '.teaser-preview-box, #map, .google_map{border-color:'.$generalcolor.'}'."\n";
}
$custom_css .= 'ul.tabs-right li.active a{border-right:solid 1px '.$generalcolor.'}'."\n";
$custom_css .= 'ul.tabs-left li.active a{border-left:solid 1px '.$generalcolor.'}'."\n";
$custom_css .= 'ul.tabs-top li.active a, ul.tabs li.active a{border-top:solid 1px '.$generalcolor.'}'."\n";
$custom_css .= 'ul.tabs-bottom li.active a{border-bottom:solid 1px '.$generalcolor.'}'."\n";
$custom_css .= 'h1,h2,h3,h4,h5,h6{color:'.$headingcolor.'}'."\n";
$custom_css .= '#top-info{background:'.$topareabg.'}'."\n";
$custom_css .= '#top-info, #top-info span, #top-info a, #top-info a:visited{color:'.$topareatext.'}'."\n";
$custom_css .= '#mainmenu-wrapper{background:'.$menuareabg.'}'."\n";
if($menuareabg!=""){
$custom_css .= '#mainmenu-wrapper{border-color:'.$bordermenuarea.'}'."\n";
}
$custom_css .= '#mainmenu-wrapper, #mainmenu-wrapper .socials-list li a, #mainmenu-wrapper .socials-list li a:visited, #mainmenu-wrapper #top-socials a, #mainmenu-wrapper #top-socials a:visited{color:'.$socialiconcolor.'}'."\n";
$custom_css .= '#mainmenu ul li a, #mainmenu ul li li a:hover, #mainmenu ul li li:hover > a
#mainmenu ul li li.current_page_item > a, #mainmenu ul li li.current_page_item:hover > a,
#mainmenu ul li li.current_page_parent > a, #mainmenu ul li li.current_page_parent:hover > a,
#mainmenu ul li li.current-menu-parent > a, #mainmenu ul li li.current-menu-parent:hover > a,
#mainmenu ul li li.current-menu-item > a, #mainmenu ul li li.current-menu-ancestor > a{color:'.$menucolor.'}'."\n";
$custom_css .= '#mainmenu ul li:hover,
#mainmenu li.current_page_item,
#mainmenu li.current_page_parent,
#mainmenu li.current-menu-parent,
#mainmenu li.current-menu-item{background:'.$bgmenucolor.'}'."\n";
if($bgmenucolor!=""){
$custom_css .= '#mainmenu ul li:hover,
#mainmenu li.current_page_item,
#mainmenu li.current_page_parent,
#mainmenu li.current-menu-parent,
#mainmenu li.current-menu-item{border-color:'.$bordermenuactive.'}'."\n";
}
$custom_css .= '#menu li ul a,#menu li ul a:visited{color:#828282;}';
$custom_css .= '#slideshow-container{background:'.$slideshowbg.'}'."\n";
$custom_css .= 'footer{background:'.$footerbg.'}'."\n";
$custom_css .= 'footer ul li a, footer ul li a:visited, footer p{color:'.$footertextcolor.' !important}'."\n";
if($footertextcolor!=""){
$custom_css .= 'footer ul li a:hover{color:'.$footermenuhover.' !important}'."\n";
}
$custom_css .= 'footer h1, footer h2, footer h3, footer h4, footer h5, footer h6{color:'.$footerheadingcolor.'}'."\n";
$custom_css .= 'footer .circle-social li, footer .circle-icon, footer .square-social li, footer .square-icon {background:'.$footersocialcolor.'}'."\n";
$custom_css .= 'footer .circle-social li:hover, footer .square-social li:hover, footer .circle-icon:hover, footer .square-icon:hover {background:'.$footersocialhover.'}'."\n";