wordpress テンプレファイル作成
ベースとなるテンプレファイルを作成し
これを元にテンプレを作成します
header.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!DOCTYPE html> <html lang= "ja" > <head> <meta charset= "utf-8" > <title> <?php wp_title( '|' , true, 'right' ); ?> <?php bloginfo( 'name' ); ?> </title> <meta name= "viewport" content= "width=device-width, initial-scale=1.0" > <link rel= "stylesheet" href= "<?php echo get_stylesheet_uri(); ?>" > <?php wp_head(); ?> </head> <body <?php body_class(); ?>> |
index.php と single.php は
1 2 3 4 | <?php get_header(); ?> <?php get_footer(); ?> |
fotter.php は
1 2 3 | <?php wp_footer(); ?> </body> </html> |
としました
せっかくなので
github に保存しておくことにします
1 2 | git clone git@github.com:Snowpooll /wordpress_test .git cd wordpress_test/ |
で移動します
次にファイルを git add で追加します
複数あるので、これはスペース区切りで追加できますが
拡張子ですべて選択するほうが楽なので
1 2 | cp ../*.php . git add *.php |
としました
そして commit します
1 | git commit -m "テンプレファイル追加" |
そしてこれを
1 | git push origin master |
で反映します
これで github に保存できました