Suche senden
Hochladen
20100116 01 Word Pressテンプレートのカスタマイズ&Xml出力
•
Als PPTX, PDF herunterladen
•
5 gefällt mir
•
4,498 views
Takashi Uemura
Folgen
2010/1/16に行ったWordPress初心者向けの勉強会プレゼンテーションです。
Weniger lesen
Mehr lesen
Technologie
Melden
Teilen
Melden
Teilen
1 von 90
Jetzt herunterladen
Empfohlen
史上最经典的Word press 主题教程
史上最经典的Word press 主题教程
chenronglin
Retención a la fuente
Retención a la fuente
pokjontas
Retención a la fuente
Retención a la fuente
pokjontas
Manual de office pdf lopez de la cruz
Manual de office pdf lopez de la cruz
josuedlacruz
Retención en la fuente 1
Retención en la fuente 1
DIEGORINCON22
Waardig Organiseren Artikel
Waardig Organiseren Artikel
Albert Jan Stam
Proyecto formativo
Proyecto formativo
jhonfospino
Proyecto formativo
Proyecto formativo
samy meza alvarez
Empfohlen
史上最经典的Word press 主题教程
史上最经典的Word press 主题教程
chenronglin
Retención a la fuente
Retención a la fuente
pokjontas
Retención a la fuente
Retención a la fuente
pokjontas
Manual de office pdf lopez de la cruz
Manual de office pdf lopez de la cruz
josuedlacruz
Retención en la fuente 1
Retención en la fuente 1
DIEGORINCON22
Waardig Organiseren Artikel
Waardig Organiseren Artikel
Albert Jan Stam
Proyecto formativo
Proyecto formativo
jhonfospino
Proyecto formativo
Proyecto formativo
samy meza alvarez
The future of social media
The future of social media
Andrew Nicholson
Módulo 5
Módulo 5
JORGE AMERICO PALACIOS PALACIOS
Sist. gestión de calidad
Sist. gestión de calidad
Ronald Paul Torrejon Infante
Sims 2 100 Baby Challenge
Sims 2 100 Baby Challenge
guestc83ec0
Unidad i y ii
Unidad i y ii
Arturo Muñoz
http://ainsamadi.blogspot.com/2013/03/panduan-pelaksanaan-dan-modul-program m...
http://ainsamadi.blogspot.com/2013/03/panduan-pelaksanaan-dan-modul-program m...
Noor Aini Samsusah
61509468 codigo-de-etica-del-psicologo
61509468 codigo-de-etica-del-psicologo
Brenda Ortíz
Retención en la fuente
Retención en la fuente
santatis
Curso Gestión de Procesos FEB.2014 - Dr. Miguel Aguilar Serrano
Curso Gestión de Procesos FEB.2014 - Dr. Miguel Aguilar Serrano
Miguel Aguilar
Cápsula 1. estudios de mercado
Cápsula 1. estudios de mercado
Audias Torres Coronel
C:\Fakepath\Christie
C:\Fakepath\Christie
Nerissaemerald
Estrategias competitivas básicas
Estrategias competitivas básicas
LarryJimenez
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
Chicago EXPO Creating a Pure CSS Template in Joomla 1.5
Chicago EXPO Creating a Pure CSS Template in Joomla 1.5
compassdesign
Denver CMS Expo Creating CSS template
Denver CMS Expo Creating CSS template
compassdesign
Creating CSS Template with Barrie North
Creating CSS Template with Barrie North
John Coonen
PHP通用程序的模板运行机制
PHP通用程序的模板运行机制
horseluke
Google App Engine Devfest 200810 External
Google App Engine Devfest 200810 External
junyu
如何修改Word press模板
如何修改Word press模板
peterton
Word press theme主题制作教程
Word press theme主题制作教程
pangyuxing
PHP通用程序的模板组织机制
PHP通用程序的模板组织机制
horseluke
Weitere ähnliche Inhalte
Andere mochten auch
The future of social media
The future of social media
Andrew Nicholson
Módulo 5
Módulo 5
JORGE AMERICO PALACIOS PALACIOS
Sist. gestión de calidad
Sist. gestión de calidad
Ronald Paul Torrejon Infante
Sims 2 100 Baby Challenge
Sims 2 100 Baby Challenge
guestc83ec0
Unidad i y ii
Unidad i y ii
Arturo Muñoz
http://ainsamadi.blogspot.com/2013/03/panduan-pelaksanaan-dan-modul-program m...
http://ainsamadi.blogspot.com/2013/03/panduan-pelaksanaan-dan-modul-program m...
Noor Aini Samsusah
61509468 codigo-de-etica-del-psicologo
61509468 codigo-de-etica-del-psicologo
Brenda Ortíz
Retención en la fuente
Retención en la fuente
santatis
Curso Gestión de Procesos FEB.2014 - Dr. Miguel Aguilar Serrano
Curso Gestión de Procesos FEB.2014 - Dr. Miguel Aguilar Serrano
Miguel Aguilar
Cápsula 1. estudios de mercado
Cápsula 1. estudios de mercado
Audias Torres Coronel
C:\Fakepath\Christie
C:\Fakepath\Christie
Nerissaemerald
Estrategias competitivas básicas
Estrategias competitivas básicas
LarryJimenez
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
Andere mochten auch
(14)
The future of social media
The future of social media
Módulo 5
Módulo 5
Sist. gestión de calidad
Sist. gestión de calidad
Sims 2 100 Baby Challenge
Sims 2 100 Baby Challenge
Unidad i y ii
Unidad i y ii
http://ainsamadi.blogspot.com/2013/03/panduan-pelaksanaan-dan-modul-program m...
http://ainsamadi.blogspot.com/2013/03/panduan-pelaksanaan-dan-modul-program m...
61509468 codigo-de-etica-del-psicologo
61509468 codigo-de-etica-del-psicologo
Retención en la fuente
Retención en la fuente
Curso Gestión de Procesos FEB.2014 - Dr. Miguel Aguilar Serrano
Curso Gestión de Procesos FEB.2014 - Dr. Miguel Aguilar Serrano
Cápsula 1. estudios de mercado
Cápsula 1. estudios de mercado
C:\Fakepath\Christie
C:\Fakepath\Christie
Estrategias competitivas básicas
Estrategias competitivas básicas
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Ähnlich wie 20100116 01 Word Pressテンプレートのカスタマイズ&Xml出力
Chicago EXPO Creating a Pure CSS Template in Joomla 1.5
Chicago EXPO Creating a Pure CSS Template in Joomla 1.5
compassdesign
Denver CMS Expo Creating CSS template
Denver CMS Expo Creating CSS template
compassdesign
Creating CSS Template with Barrie North
Creating CSS Template with Barrie North
John Coonen
PHP通用程序的模板运行机制
PHP通用程序的模板运行机制
horseluke
Google App Engine Devfest 200810 External
Google App Engine Devfest 200810 External
junyu
如何修改Word press模板
如何修改Word press模板
peterton
Word press theme主题制作教程
Word press theme主题制作教程
pangyuxing
PHP通用程序的模板组织机制
PHP通用程序的模板组织机制
horseluke
Html&css基础
Html&css基础
KenerLinfeng
富文本编辑器在互联网上的应用
富文本编辑器在互联网上的应用
luolonghao
2017 開源人年會 (COSCUP) - WooCommerce 開發入門的準備動作
2017 開源人年會 (COSCUP) - WooCommerce 開發入門的準備動作
Kuohui Lu
揭秘Html5和Css3
揭秘Html5和Css3
Adam Lu
揭秘Html5和Css3 ---- 鲁超伍
揭秘Html5和Css3 ---- 鲁超伍
裕波 周
Html5css3 go.yeefe.com
Html5css3 go.yeefe.com
tellyeefe
[數學軟體應用] 05 HTML+CSS
[數學軟體應用] 05 HTML+CSS
Yen-lung Tsai
0220 Windows server 2008 PowerShell
0220 Windows server 2008 PowerShell
Timothy Chen
Web base 吴志华
Web base 吴志华
FLASH开发者交流会
Web 01
Web 01
Samantha Lin
第01讲 php环境搭配和
第01讲 php环境搭配和
cyfp
日新培训
日新培训
pan quanjin
Ähnlich wie 20100116 01 Word Pressテンプレートのカスタマイズ&Xml出力
(20)
Chicago EXPO Creating a Pure CSS Template in Joomla 1.5
Chicago EXPO Creating a Pure CSS Template in Joomla 1.5
Denver CMS Expo Creating CSS template
Denver CMS Expo Creating CSS template
Creating CSS Template with Barrie North
Creating CSS Template with Barrie North
PHP通用程序的模板运行机制
PHP通用程序的模板运行机制
Google App Engine Devfest 200810 External
Google App Engine Devfest 200810 External
如何修改Word press模板
如何修改Word press模板
Word press theme主题制作教程
Word press theme主题制作教程
PHP通用程序的模板组织机制
PHP通用程序的模板组织机制
Html&css基础
Html&css基础
富文本编辑器在互联网上的应用
富文本编辑器在互联网上的应用
2017 開源人年會 (COSCUP) - WooCommerce 開發入門的準備動作
2017 開源人年會 (COSCUP) - WooCommerce 開發入門的準備動作
揭秘Html5和Css3
揭秘Html5和Css3
揭秘Html5和Css3 ---- 鲁超伍
揭秘Html5和Css3 ---- 鲁超伍
Html5css3 go.yeefe.com
Html5css3 go.yeefe.com
[數學軟體應用] 05 HTML+CSS
[數學軟體應用] 05 HTML+CSS
0220 Windows server 2008 PowerShell
0220 Windows server 2008 PowerShell
Web base 吴志华
Web base 吴志华
Web 01
Web 01
第01讲 php环境搭配和
第01讲 php环境搭配和
日新培训
日新培训
Mehr von Takashi Uemura
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
Takashi Uemura
さくらのナレッジ5周年ナイトLT
さくらのナレッジ5周年ナイトLT
Takashi Uemura
WAFって言いたいだけちゃうんか
WAFって言いたいだけちゃうんか
Takashi Uemura
アイドル画像ギャラリーサイトを作ったあとどうなったか
アイドル画像ギャラリーサイトを作ったあとどうなったか
Takashi Uemura
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
Takashi Uemura
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
Takashi Uemura
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
Takashi Uemura
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
Takashi Uemura
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
Takashi Uemura
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
Takashi Uemura
WordPressの使えるプラグイン2013
WordPressの使えるプラグイン2013
Takashi Uemura
WordPress 多言語化プラグインqTranslateの紹介
WordPress 多言語化プラグインqTranslateの紹介
Takashi Uemura
WordPressテーマ Foundation for WordPress の紹介
WordPressテーマ Foundation for WordPress の紹介
Takashi Uemura
What's new! TwentyThirteen + WordPress3.6
What's new! TwentyThirteen + WordPress3.6
Takashi Uemura
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
Takashi Uemura
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
Takashi Uemura
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
Takashi Uemura
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
Takashi Uemura
WordCampOsaka2012 闇WordCamp XOOPS編
WordCampOsaka2012 闇WordCamp XOOPS編
Takashi Uemura
WordCampOsaka2012 WordPressあるある
WordCampOsaka2012 WordPressあるある
Takashi Uemura
Mehr von Takashi Uemura
(20)
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
さくらのナレッジ5周年ナイトLT
さくらのナレッジ5周年ナイトLT
WAFって言いたいだけちゃうんか
WAFって言いたいだけちゃうんか
アイドル画像ギャラリーサイトを作ったあとどうなったか
アイドル画像ギャラリーサイトを作ったあとどうなったか
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
WordPressの使えるプラグイン2013
WordPressの使えるプラグイン2013
WordPress 多言語化プラグインqTranslateの紹介
WordPress 多言語化プラグインqTranslateの紹介
WordPressテーマ Foundation for WordPress の紹介
WordPressテーマ Foundation for WordPress の紹介
What's new! TwentyThirteen + WordPress3.6
What's new! TwentyThirteen + WordPress3.6
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
WordCampOsaka2012 闇WordCamp XOOPS編
WordCampOsaka2012 闇WordCamp XOOPS編
WordCampOsaka2012 WordPressあるある
WordCampOsaka2012 WordPressあるある
20100116 01 Word Pressテンプレートのカスタマイズ&Xml出力
1.
WordPressテーマカスタマイズ&XML出力 2010/1/16 フリーランスシステムエンジニア
上村 崇
2.
はじめに
3.
このプレゼンは後で公開しますので 書き写す必要はありません
4.
質問は随時、挙手で
5.
それでは本題
6.
まずはじめに、 WordPressのテーマをカスタマイズする方法について つぎに、
XMLファイルを出力する 方法について
7.
8.
WordPressとは
9.
ブログツールの一つ
10.
PHPで作られています
11.
MySQLを使っています
12.
創始者Matt Mullenweg氏26歳
13.
ブログツール比較 日本 全世界
14.
CMS比較 日本 全世界
15.
WordPressが 2009年のベストCMS賞を獲得
16.
テーマについて
17.
テーマは無数にあります
18.
19.
20.
21.
22.
23.
24.
25.
テーマをカスタマイズしましょう!
26.
もちろん HTML スタイルシート
の知識は必要ですが
27.
WordPress ディレクトリ構成 PHP
テンプレート テンプレートタグ
28.
WordPressディレクトリ構成
29.
themes classic 初期状態でテーマは2つ
30.
themes default とりあえずテーマファイルの置き場所だけ知っていればいいです
31.
PHPの基本
32.
まず、普通のHTMLファイルは こんなのです。
33.
index.html <html>
<head> <title>文書のタイトル</title> </head> <body> 文書の本文 </body> </html>
34.
同じことをPHPでやると、 こうなります。
35.
index.php <?php echo
"<html>"; echo " <head>"; echo " <title>文書のタイトル</title>"; echo " </head>"; echo " <body>"; echo "文書の本文"; echo " </body>"; echo "</html>"; ?>
36.
別の方法もあります。
37.
index.php <?php
$title = "文書のタイトル"; $contents = "文書の本文"; ?> <html> <head> <title><?phpecho $title ?></title> </head> <body> <?phpecho $contents ?> </body> </html>
38.
つまり、 PHPを書くときは<?php
?> で囲む
39.
テンプレートと テンプレートタグ
40.
ブロックに分けて考えてみます
41.
header main contents
sidebar footer
42.
コードで表すとこうなります->
43.
index.php <?phpget_header();?> <?phpif
( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?>
44.
index.php <?phpget_header();?> <?phpif
( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> WordPressループ (Main Contents)
45.
index.php <?phpget_header();?> <?phpif
( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> header main contents sidebar footer
46.
index.php <?phpget_header();?> <?phpif
( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> header main contents sidebar footer
47.
index.php <?phpget_header();?> <?phpif
( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> header main contents sidebar footer
48.
index.php <?phpget_header();?> <?phpif
( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> header main contents sidebar footer
49.
index.php <?phpget_header();?> <?phpif
( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> テンプレートタグ WordPress組込の関数
50.
index.php header.php <?phpget_header();?>
<?phpif ( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> sidebar.php footer.php
51.
default テンプレート
52.
Headerについて詳しく見てみます。
53.
header
54.
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" <?phplanguage_attributes(); ?>> <head> <meta http-equiv="Content-Type" content="<?phpbloginfo('html_type'); ?>; charset=<?phpbloginfo('charset'); ?>" /> <title> <?phpwp_title('«', true, 'right'); ?> <?phpbloginfo('name'); ?> </title> <link rel="stylesheet" href="<?phpbloginfo('stylesheet_url'); ?>" type="text/css” /> <style type="text/css”> #page { background: url("<?phpbloginfo('stylesheet_directory'); ?>/images/kubrickbg-ltr.jpg“) } </style> <?phpwp_head(); ?> </head> <body> <div id="page"> <div id="header" role="banner"> <div id="headerimg"> <h1><a href="<?php echo get_option('home'); ?>/"><?phpbloginfo('name'); ?></a></h1> <div class="description"><?phpbloginfo('description'); ?></div> </div> </div>
55.
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" <?phplanguage_attributes(); ?>> <head> <meta http-equiv="Content-Type" content="<?phpbloginfo('html_type'); ?>; charset=<?phpbloginfo('charset'); ?>" /> <title> <?phpwp_title('«', true, 'right'); ?> <?phpbloginfo('name'); ?> </title> <link rel="stylesheet" href="<?phpbloginfo('stylesheet_url'); ?>" type="text/css” /> <style type="text/css”> #page { background: url("<?phpbloginfo('stylesheet_directory'); ?>/images/kubrickbg-ltr.jpg“) } </style> <?phpwp_head(); ?> </head> <body> <div id="page"> <div id="header" role="banner"> <div id="headerimg"> <h1><a href="<?php echo get_option('home'); ?>/"><?phpbloginfo('name'); ?></a></h1> <div class="description"><?phpbloginfo('description'); ?></div> </div> </div> URL タイトル サイトの説明
56.
URL タイトル サイトの説明
57.
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" <?phplanguage_attributes(); ?>> <head> <meta http-equiv="Content-Type" content="<?phpbloginfo('html_type'); ?>; charset=<?phpbloginfo('charset'); ?>" /> <title> <?phpwp_title('«', true, 'right'); ?> <?phpbloginfo('name'); ?> </title> <link rel="stylesheet" href="<?phpbloginfo('stylesheet_url'); ?>" type="text/css” /> <style type="text/css”> #page { background: url("<?phpbloginfo('stylesheet_directory'); ?>/images/kubrickbg-ltr.jpg“) } </style> <?phpwp_head(); ?> </head> <body> <div id="page"> <div id="header" role="banner"> <div id="headerimg"> <h1><a href="<?php echo get_option('home'); ?>/"><?phpbloginfo('name'); ?></a></h1> <div class="description"><?phpbloginfo('description'); ?></div> </div> </div>
58.
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" <?phplanguage_attributes(); ?>> <head> <meta http-equiv="Content-Type" content="<?phpbloginfo('html_type'); ?>; charset=<?phpbloginfo('charset'); ?>" /> <title> <?phpwp_title('«', true, 'right'); ?> <?phpbloginfo('name'); ?> </title> <link rel="stylesheet" href="<?phpbloginfo('stylesheet_url'); ?>" type="text/css” /> <style type="text/css”> #page { background: url("<?phpbloginfo('stylesheet_directory'); ?>/images/kubrickbg-ltr.jpg“) } </style> <?phpwp_head(); ?> </head> <body> <div id="page"> <div id="header" role="banner"> <div id="headerimg"> <h1><a href="<?php echo get_option('home'); ?>/"><?phpbloginfo('name'); ?></a></h1> <div class="description"><?phpbloginfo('description'); ?></div> </div> </div> ドキュメントの 場所は?
59.
wordpresscodex 検 索
60.
次に、WordPressループの説明
61.
index.php WordPressループ (Main
Contents) <?phpget_header();?> <?phpif ( have_posts() ) : ?> <?phpwhile (have_posts()) : the_post(); ?> <?phpendwhile;?> <?phpelse :?> <?phpendif; ?> <?phpget_sidebar(); ?> <?phpget_footer();?> header main contents sidebar footer
62.
繰り返し 記事タイトル 日付
本文 カテゴリ、コメント
63.
WordPressループ <?phpif (have_posts())
: ?> <?phpwhile (have_posts()) : the_post(); ?> <div <?phppost_class(); ?> id="post-<?phpthe_ID(); ?>"> <h2><a href="<?phpthe_permalink()?>“ ><?phpthe_title(); ?></a></h2> <small><?phpthe_time(__('F jS, Y', 'kubrick'))?></small> <div class="entry"> <?phpthe_content(__('Read the rest of this entry »', 'kubrick')); ?> </div> <p class="postmetadata"> <?phpprintf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> | <?phpedit_post_link(__('Edit', 'kubrick'), '', ' | '); ?> <?phpcomments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> </p> </div> <?phpendwhile; ?> <?phpelse : ?> <h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2> <p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p> <?phpget_search_form(); ?> <?phpendif; ?>
64.
<?phpif (have_posts()) :
?> <?phpwhile (have_posts()) : the_post(); ?> <div <?phppost_class(); ?> id="post-<?phpthe_ID(); ?>"> <h2><a href="<?phpthe_permalink()?>“ ><?phpthe_title(); ?></a></h2> <small><?phpthe_time(__('F jS, Y', 'kubrick'))?></small> <div class="entry"> <?phpthe_content(__('Read the rest of this entry »', 'kubrick')); ?> </div> <p class="postmetadata"> <?phpprintf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> | <?phpedit_post_link(__('Edit', 'kubrick'), '', ' | '); ?> <?phpcomments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> </p> </div> <?phpendwhile; ?> <?phpelse : ?> <h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2> <p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p> <?phpget_search_form(); ?> <?phpendif; ?> 投稿があればtrue、なければfalse 投稿がある場合の処理 投稿がない場合の処理
65.
<?phpif (have_posts()) :
?> <?phpwhile (have_posts()) : the_post(); ?> <div <?phppost_class(); ?> id="post-<?phpthe_ID(); ?>"> <h2><a href="<?phpthe_permalink()?>“ ><?phpthe_title(); ?></a></h2> <small><?phpthe_time(__('F jS, Y', 'kubrick'))?></small> <div class="entry"> <?phpthe_content(__('Read the rest of this entry »', 'kubrick')); ?> </div> <p class="postmetadata"> <?phpprintf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> | <?phpedit_post_link(__('Edit', 'kubrick'), '', ' | '); ?> <?phpcomments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> </p> </div> <?phpendwhile; ?> <?phpelse : ?> <h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2> <p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p> <?phpget_search_form(); ?> <?phpendif; ?> 投稿がある場合の処理
66.
<?phpif (have_posts()) :
?> <?phpwhile (have_posts()) : the_post(); ?> <div <?phppost_class(); ?> id="post-<?phpthe_ID(); ?>"> <h2><a href="<?phpthe_permalink()?>“ ><?phpthe_title(); ?></a></h2> <small><?phpthe_time(__('F jS, Y', 'kubrick'))?></small> <div class="entry"> <?phpthe_content(__('Read the rest of this entry »', 'kubrick')); ?> </div> <p class="postmetadata"> <?phpprintf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> | <?phpedit_post_link(__('Edit', 'kubrick'), '', ' | '); ?> <?phpcomments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> </p> </div> <?phpendwhile; ?> <?phpelse : ?> <h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2> <p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p> <?phpget_search_form(); ?> <?phpendif; ?> 投稿がある間Loopする 投稿1つ分の準備 投稿の数だけループ
67.
<?phpif (have_posts()) :
?> <?phpwhile (have_posts()) : the_post(); ?> <div <?phppost_class(); ?> id="post-<?phpthe_ID(); ?>"> <h2><a href="<?phpthe_permalink()?>“ ><?phpthe_title(); ?></a></h2> <small><?phpthe_time(__('F jS, Y', 'kubrick'))?></small> <div class="entry"> <?phpthe_content(__('Read the rest of this entry »', 'kubrick')); ?> </div> <p class="postmetadata"> <?phpprintf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?> | <?phpedit_post_link(__('Edit', 'kubrick'), '', ' | '); ?> <?phpcomments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?> </p> </div> <?phpendwhile; ?> <?phpelse : ?> <h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2> <p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p> <?phpget_search_form(); ?> <?phpendif; ?> タイトル 本文 全部理解しないと いけないの?
68.
・すべてのコードを理解する必要はない。 ・イメージにあったテーマを見つけてきて、
それをカスタマイズすればよい。
69.
default 他のファイルは?
70.
← not foundページ
アーカイブページ コメントページ ← 共通関数用 ← 画像一覧ページ default 言語関連ファイル ← リンクページ ← 特定の1ページ ← テーマのスクリーンショット ← 検索ページ ← 1投稿分の詳細ページ
71.
テーマのカスタマイズ方法 終わり
72.
つぎに、 XMLファイルを出力する 方法について
73.
「MTだったらXMLの書き出しが比較的簡単に出来るんですが WPだとなかなか難しいみたいで、僕の希望としましてはWPを使ってXMLの簡単な 書き出し方法があればご教授頂きたいなと思います。RSSやFlashに使うときに便利なので・・・。」
74.
最新の投稿一覧 カテゴリー毎一覧 XML
75.
最新の投稿一覧 カテゴリー毎一覧 XML
作る
76.
仕様: 最新の投稿5件をXMLファイルに出力します。 ・日付
・タイトル ・投稿内容 ・カテゴリ
77.
最新の投稿を出す方法は index.phpを参考にできる
78.
79.
XML出力イメージ ・・・
80.
Step1: XMLを出力するコードを作成します
81.
<?php/* Template Name:
XmlForFlash */?> <?php header('Content-Type: text/xml; charset='.get_option('blog_charset'), true); ?> <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.‘>’; ?> <root> <?phpquery_posts("posts_per_page=5"); ?> <?phpif (have_posts()) : ?> <?phpwhile (have_posts()) : the_post(); ?> <item> <title><![CDATA[<?php echo the_title_rss(); ?>]]></title> <pubdate><?php echo the_time('Y-m-d H:i:s’); ?></pubdate> <?phpthe_category_rss(); ?> <description><![CDATA[<?phpthe_content_rss(); ?>]]></description> </item> <?phpendwhile; ?> <?phpendif; ?> </root> <?xml version="1.0" encoding=“UTF-8” ?> タイトル 時 刻 <category> </category> カテゴリ 本文内容 テンプレートタグで書くと?
82.
<?php/* Template Name:
XmlForFlash */?> <?php header('Content-Type: text/xml; charset='.get_option('blog_charset'), true); ?> <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.‘>’; ?> <root> <?phpquery_posts("posts_per_page=5"); ?> <?phpif (have_posts()) : ?> <?phpwhile (have_posts()) : the_post(); ?> <item> <title><![CDATA[<?php echo the_title_rss(); ?>]]></title> <pubdate><?php echo the_time('Y-m-d H:i:s’); ?></pubdate> <?phpthe_category_rss(); ?> <description><![CDATA[<?phpthe_content_rss(); ?>]]></description> </item> <?phpendwhile; ?> <?phpendif; ?> </root> 続いてループ処理を挿入->
83.
<?php/* Template Name:
XmlForFlash */?> <?php header('Content-Type: text/xml; charset='.get_option('blog_charset'), true); ?> <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.‘>’; ?> <root> <?phpquery_posts("posts_per_page=5"); ?> <?phpif (have_posts()) : ?> <?phpwhile (have_posts()) : the_post(); ?> <item> <title><![CDATA[<?php echo the_title_rss(); ?>]]></title> <pubdate><?php echo the_time('Y-m-d H:i:s’); ?></pubdate> <?phpthe_category_rss(); ?> <description><![CDATA[<?phpthe_content_rss(); ?>]]></description> </item> <?phpendwhile; ?> <?phpendif; ?> </root> 最新の5件を取得->
84.
<?php/* Template Name:
XmlForFlash */?> <?php header('Content-Type: text/xml; charset='.get_option('blog_charset'), true); ?> <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.‘>’; ?> <root> <?phpquery_posts("posts_per_page=5"); ?> <?phpif (have_posts()) : ?> <?phpwhile (have_posts()) : the_post(); ?> <item> <title><![CDATA[<?php echo the_title_rss(); ?>]]></title> <pubdate><?php echo the_time('Y-m-d H:i:s’); ?></pubdate> <?phpthe_category_rss(); ?> <description><![CDATA[<?phpthe_content_rss(); ?>]]></description> </item> <?phpendwhile; ?> <?phpendif; ?> </root>
85.
default 新規作成
86.
Step2: ファイルをWordPressに登録します
87.
①外観 > 編集
②作ったテンプレートファイルがエントリされていることを確認
88.
①ページ > 新規追加
②タイトルを入れる ③XmlForFlashを選択する
89.
保存するとURLが得られます。
90.
完成!
Jetzt herunterladen