Processing math: 100%

[_s] footer.php

footer.php

footer.phpは、_sのテンプレートパートファイルで、フッター部分を担当します。全てのテンプレートファイルから、get_footer()関数を使って読み込まれます。

ただし、header.phpと同様に、厳密にはfooterだけではなく、コンテント部分のdivの閉じタグや、最終的なbodyやhtmlの閉じタグも含まれています。

ソース

https://github.com/Automattic/_s/blob/master/footer.php

<?php
/**
* The template for displaying the footer
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package _s
*/
?>
</div><!-- #content -->
<footer id="colophon" class="site-footer">
<div class="site-info">
<a href="<?php echo esc_url( __( 'https://wordpress.org/', '_s' ) ); ?>">
<?php
/* translators: %s: CMS name, i.e. WordPress. */
printf( esc_html__( 'Proudly powered by %s', '_s' ), 'WordPress' );
?>
</a>
<span class="sep"> | </span>
<?php
/* translators: 1: Theme name, 2: Theme author. */
printf( esc_html__( 'Theme: %1sbys.', '_s' ), '_s', '<a href="https://automattic.com/">Automattic</a>' );
?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>
<?php /** * The template for displaying the footer * * Contains the closing of the #content div and all content after. * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * * @package _s */ ?> </div><!-- #content --> <footer id="colophon" class="site-footer"> <div class="site-info"> <a href="<?php echo esc_url( __( 'https://wordpress.org/', '_s' ) ); ?>"> <?php /* translators: %s: CMS name, i.e. WordPress. */ printf( esc_html__( 'Proudly powered by %s', '_s' ), 'WordPress' ); ?> </a> <span class="sep"> | </span> <?php /* translators: 1: Theme name, 2: Theme author. */ printf( esc_html__( 'Theme: %1sbys.', '_s' ), '_s', '<a href="https://automattic.com/">Automattic</a>' ); ?> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html>
<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package _s
 */

?>

	</div><!-- #content -->

	<footer id="colophon" class="site-footer">
		<div class="site-info">
			<a href="<?php echo esc_url( __( 'https://wordpress.org/', '_s' ) ); ?>">
				<?php
				/* translators: %s: CMS name, i.e. WordPress. */
				printf( esc_html__( 'Proudly powered by %s', '_s' ), 'WordPress' );
				?>
			</a>
			<span class="sep"> | </span>
				<?php
				/* translators: 1: Theme name, 2: Theme author. */
				printf( esc_html__( 'Theme: %1$s by %2$s.', '_s' ), '_s', '<a href="https://automattic.com/">Automattic</a>' );
				?>
		</div><!-- .site-info -->
	</footer><!-- #colophon -->
</div><!-- #page -->

<?php wp_footer(); ?>

</body>
</html>

id=”colophon”

colophonは、日本語でいうところの奥付に相当するものを意味するそうです。

wikipedia Colophon (publishing)

wp_footer()

テーマテンプレートファイル内の </body> タグ直前に、必ず書くルールになっています。
‘wp_footer’ アクションフックをスタートするのに使われるので、これがないとプラグイン等が正常に機能しない可能性があります。

WordPress Codex テンプレートタグ/wp footer