我尝试将此添加到儿童主题functions.php
。我使用徽标网址的代码作为模型。我需要标语链接到网址。
add_action('parse_request', 'my_custom_url_handler');
function my_custom_url_handler() {
if ( !in_array( '__navbar' , $wp_current_filter ) )
<span class="header-tagline <?php czr_fn_echo( 'element_class' ) ?>"
<?php czr_fn_echo( 'element_attributes' ) ?>>
<a href="<?php echo esc_url( home_url( '/' ) )
<?php echo get_bloginfo( 'description', 'display' ) ?>
</a>
</span>
<?php endif; ?>
}
add_filter('option_blogdescription', 'custom_option_description', 10, 1);
function custom_option_description($value) {
return 'custom description';
}
子函数文件中的简单函数