Ade*_*lin 0 wordpress wordpress-theming
我试图了解在 WP 中创建的主题。根据我的理解 wp_footer() 在主页中包含 footer.php 。但我不明白的是为什么 wp_footer() 像在 27 页脚中一样在 footer.php 中被调用?
</div><!-- #content -->
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="wrap">
<?php
get_template_part( 'template-parts/footer/footer', 'widgets' );
if ( has_nav_menu( 'social' ) ) : ?>
<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentyseventeen' ); ?>">
<?php
wp_nav_menu( array(
'theme_location' => 'social',
'menu_class' => 'social-links-menu',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ),
) );
?>
</nav><!-- .social-navigation -->
<?php endif;
get_template_part( 'template-parts/footer/site', 'info' );
?>
</div><!-- .wrap -->
</footer><!-- #colophon -->
</div><!-- .site-content-contain -->
</div><!-- #page -->
<?php wp_footer(); Here?>
Run Code Online (Sandbox Code Playgroud)
wp_footer() 在 wordpress 中不用于包含页脚,实际上 get_footer() 就是这样做的。
wp_footer() 用于输出数据或执行在关闭 body 标签之前运行的后台操作。
希望说清楚!!
归档时间: |
|
查看次数: |
1549 次 |
最近记录: |