以前、wordpressの固定ページだけを用いた10ページ程度のサイトを作ったことがある。 その際に自前でテーマを書いたのだけど、そのひな形にしたのがこんな感じのもの。
デレクトリ wp-content/themes/ に適当な名前でデレクトリを作る。とりあえず「zzz00」とでもしておく。 その中に以下のファイルをアップする。
880x660ピクセルのjpg画像。内容はどうでもいい。
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="<?php bloginfo('charset'); ?>" /> <title><?php bloginfo('name'); ?><?php wp_title(); ?></title> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" /> </head> <body> <h1><?php bloginfo('name'); ?></h1> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'menu_id' => 'primary-menu' ) ); ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php remove_filter ('the_content', 'wpautop'); ?><?php the_content(); ?> <?php endwhile; endif; ?> </body> </html>
自動整形(勝手に<p>だか<br>だかを挿入する機能)を無効にする処置を施しておいた。 なので記事を書くときはHTML手打ちになる。
/* Theme Name: zzz00 Theme URL: http://xxx.s500.xrea.com Description: zzz00 Author: xxx.s500 Version: 0.1 */
上記のようにテーマに関する情報を記入する必要がある。