実習課題のデータをWordpress化するためにしていること。
header
footer
sidebar
それぞれのカタマリをphp化。
…なんか全然フツーの「index.html」で組んだのと違う組み上がり…。
多分、まだphpに書くべきこととか、
phpにするなら書き直さないとならないソースとか、
山積みということ。
≪index.html≫
<!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"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <meta name="description" content="株式会社技研工業・住宅修理・改築・改装(電話)047-701-5101(営業時間)9:00〜17:00" /> <title>株式会社技研工業</title> <link rel="stylesheet" type="text/css" href="css/style.css" media="all" /> <script src="js/smoothScroll.js"></script> </head> <body> <div id="container"> <div id="header"> <div id="top">top</div> <img src="img/header-img.png" width="968" height="181" alt="株式会社技研工業・(電話)047-701-5101・(営業時間)9:00〜17:00"> </div> <div id="wrapper"> <div id="content"> <div class="block"> 中略 <div class="block"> <h1>会社案内</h1> <div id="gu_d"> 中略 </div> </div> <div class="block"> <h1>お問い合わせ</h1> <div id="gu_d"> <table> <tr> <th>建物のご相談</th> <td>株式会社 技研工業</td> <td>047-701-5101(9:00〜17:00)</td> </tr> <tr> <th>刃物とぎのご相談</th> <td>技術サービス<br />とぎとら</td> <td>0120-14-8899(9:00〜17:00)</td> </tr> </table> </div> </div> </div> <!-- Navi --> <div id="sidebar"> <ul> <li><a href="example/index.html"><img src="img/example-btn.png" width="208" height="61" alt="施工例"></a></li> <li><a href="togitora/index.html"><img src="img/togi_btn.png" width="208" height="61" alt="技術サービス"></a></li> </ul> </div> <p id="totop"><a href="#top">▲ このページの先頭へ</a></p> </div> <div id="footer"> <small>Copyright © 2012 株式会社技研工業 All Right Reserved.</small> </div> </div> </body> </html>
≪index.php≫
<?php get_header(); ?> <div id="content"> <?php get_template_part( 'loop' ); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
いまいちスカスカおせちな感じです。ホントに基本の骨組みだけ。
≪header.php≫
<!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"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <meta name="description" content="株式会社技研工業・住宅修理・改築・改装(電話)047-701-5101(営業時間)9:00〜17:00" /> <title><?php wp_title('name'); ?></title> <title>株式会社技研工業</title> <link rel="stylesheet" href="<?php bloginfo( 'css/style.css' ); ?>" media="all" /> <script src="js/smoothScroll.js"></script> <?php wp_head(); ?> </head> <body> <div id="header"> <div id="top">top</div> <a href="<?php bloginfo('index.html'); ?>"><img src="<?php bloginfo('template_url'); ?>/img/header-img.png" width="968" height="181" alt="株式会社技研工業・(電話)047-701-5101・(営業時間)9:00〜17:00"></a> </div>
今のところ無難に表示されている唯一のパーツ。
しかしcssで指定したpositionが効いていないので、100%成功しているわけではない。
≪footer.php≫
<div id="footer"> <small>Copyright © 2012 株式会社技研工業 All Right Reserved.</small> </div> <?php wp_footer(); ?> </body> </html>
cssで背景画像を指定しているのですが、そっちを書き直さないと画像が出てこない模様。
<div id="sidebar"> <ul> <li><a href="example/index.html"><img src="img/example-btn.png" width="208" height="61" alt="施工例"></a></li> <li><a href="togitora/index.html"><img src="img/togi_btn.png" width="208" height="61" alt="技術サービス"></a></li> </ul> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> <h2 class="widget_title">About</h2> <p>ウィジェット設定されていない場合、表示されます。</p> <?php endif; ?> </div>
リストマークが出てしまう上、本文エリアに入ってきているので、まだ修正の余地ありまくり。
しっぱさんの今日の記事と、原因は同じかもしれない(リストマークに関して)。
そして、
<div class="block">
が繰り返しになるので、
≪loop.php≫
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="block"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content(); ?> </div> <?php endwhile; endif; ?>
これを用意したものの、本文エリアには反映されていないので、
多分これもカスタマイズ不足。
記事とは無関係ですが、
生(live)ならではの良さというものは、
きっと、その時間と空間を共有した感覚が残ることかも。
と、こんなライブ映像を見つけてしみじみと。
や、ブダペストなんて行けませんが。
それにしてもブダペストの夜景ってここっきりなのかな(激しく鉄板)。
海外旅行を老後の楽しみ…にしたかったら、
いま血反吐はくほど頑張らなければならないのだ。>そしていまいち頑張り切れていないorz
でもこれ好きじゃなかったらYouTubeは使う用事がなかったし、
Facebookも見ないしTwitterも無関心でRSSも無くても困らない暮らしを続けていたはず。
…実は現在もRSS無くてもあんまり困ってなくて困ってます。