❶heade部分を書き換えheader.php-基礎編-
2016/04/04
header.htmlを書き換え header.php
header.php、loop.php、sidebar.php、footer.phpを編集していく。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta name="description" content="このサイトはサンプルサイトです。" /> <meta name="keywords" content="サイト,サンプル,テストサイト" /> <link rel="stylesheet" href="style.css" type="text/css" /> <title>サンプルブログサイト</title> </head> <body> <div id="wrapper"> <!-- header --> <div id="header"> <h1><a href="index.html">サンプルブログサイト</a></h1> </div> <!-- /header --> <!-- menu --> <div id="menu"> <ul> <li><a href="index.html">HOME</a></li> <li><a href="about.html">ABOUT</a></li> <li><a href="contact.html">お問い合わせ</a></li> </ul> </div> <!-- /menu --> |
WordPressテンプレートタグを使用して書き換えていく
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta name="description" content="<?php bloginfo('description'); ?>" /> <meta name="keywords" content="テスト,サンプル,テストサイト" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" /> <title><?php wp_title( '|', true, 'right' ); bloginfo('name'); ?></title> <?php if ( is_singular() ) wp_enqueue_script( "comment-reply" ); ?> <?php wp_head(); ?> </head> <body> <div id="wrapper"> <!-- header --> <div id="header"> <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1> </div> <!-- /header --> <!-- menu --> <div id="menu"> <?php wp_nav_menu(); ?> </div> <!-- /menu --> |