php 改变创世纪标题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 改变创世纪标题相关的知识,希望对你有一定的参考价值。
<?php // <- Don't add me in
// Gist updated to use code from Genesis Framework 2.4.2
//remove initial header functions
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
remove_action( 'genesis_header', 'genesis_do_header' );
//add in the new header markup - prefix the function name - here sm_ is used
add_action( 'genesis_header', 'sm_genesis_header_markup_open', 5 );
add_action( 'genesis_header', 'sm_genesis_header_markup_close', 15 );
add_action( 'genesis_header', 'sm_genesis_do_header' );
//New Header functions
function sm_genesis_header_markup_open() {
genesis_markup( array(
'html5' => '<header %s>',
'context' => 'site-header',
) );
// Added in content
echo '<div class="header-ghost"></div>';
genesis_structural_wrap( 'header' );
}
function sm_genesis_header_markup_close() {
genesis_structural_wrap( 'header', 'close' );
genesis_markup( array(
'close' => '</header>',
'context' => 'site-header',
) );
}
function sm_genesis_do_header() {
global $wp_registered_sidebars;
genesis_markup( array(
'open' => '<div %s>',
'context' => 'title-area',
) );
do_action( 'genesis_site_title' );
do_action( 'genesis_site_description' );
genesis_markup( array(
'close' => '</div>',
'context' => 'title-area',
) );
if ( ( isset( $wp_registered_sidebars['header-right'] ) && is_active_sidebar( 'header-right' ) ) || has_action( 'genesis_header_right' ) ) {
genesis_markup( array(
'open' => '<div %s>' . genesis_sidebar_title( 'header-right' ),
'context' => 'header-widget-area',
) );
do_action( 'genesis_header_right' );
add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
add_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );
dynamic_sidebar( 'header-right' );
remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
remove_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );
genesis_markup( array(
'close' => '</div>',
'context' => 'header-widget-area',
) );
}
}
以上是关于php 改变创世纪标题的主要内容,如果未能解决你的问题,请参考以下文章