父主题Hestia的默认页脚内容通过挂钩包括在内hestia_do_bottom_footer_content
. 因此,您可以通过remove_action
. 并在您的子主题中添加您自己的内容和功能。
父主题中的源以使此挂钩、文件有效hestia\\inc\\views\\main\\class-hestia-footer.php
:
/**
* Initialization of the feature.
*/
public function init() {
add_action( \'hestia_do_footer\', array( $this, \'the_footer_content\' ) );
add_filter( \'wp_nav_menu_args\', array( $this, \'modify_footer_menu_classes\' ) );
add_action( \'hestia_do_bottom_footer_content\', array( $this, \'bottom_footer_content\' ) );
}
内容在此方法内:
/**
* Function to display footer copyright and footer menu.
* Also used as callback for selective refresh.
*/
public function bottom_footer_content() {
$hestia_general_credits = get_theme_mod(
\'hestia_general_credits\',
sprintf(
/* translators: %1$s is Theme Name, %2$s is WordPress */
esc_html__( \'%1$s | Powered by %2$s\', \'hestia\' ),
sprintf(
/* translators: %s is Theme name */
\'<a href="https://themeisle.com/themes/hestia/" target="_blank" rel="nofollow">%s</a>\',
esc_html__( \'Hestia\', \'hestia\' )
),
/* translators: %1$s is URL, %2$s is WordPress */
sprintf(
\'<a href="%1$s" rel="nofollow">%2$s</a>\',
esc_url( __( \'http://wordpress.org\', \'hestia\' ) ),
esc_html__( \'WordPress\', \'hestia\' )
)
)
);
wp_nav_menu(
array(
\'theme_location\' => \'footer\',
\'depth\' => 1,
\'container\' => \'ul\',
\'menu_class\' => \'footer-menu\',
)
);
?>
<?php if ( ! empty( $hestia_general_credits ) || is_customize_preview() ) : ?>
<div class="copyright <?php echo esc_attr( $this->add_footer_copyright_alignment_class() ); ?>">
<?php echo wp_kses_post( $hestia_general_credits ); ?>
</div>
<?php
endif;
}