2017-08-16 103 views
0

我想了解WP中创建的主题。根据我的理解,wp_footer()在主页面包含footer.php。但我不明白的是为什么wp_footer()在footer.php中被调用,就像在二十七页脚中一样?为什么在wp_footer()footer.php本身中调用wp_footer()?

</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?> 

回答

3

wp_footer()在不用于包含页脚的wordpress中,实际上get_footer()是这样做的。

wp_footer()用于输出数据或在关闭body标签之前执行后台操作。

希望能够说清楚!

相关问题