Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
現場でも使えるWordPress.org掲載テーマのメソッド
Search
Toro_Unit (Hiroshi Urabe)
October 28, 2017
Technology
3.7k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
現場でも使えるWordPress.org掲載テーマのメソッド
https://2017.wordfes.org/sessions/1703/
WordFes 2017 での登壇資料です。
Toro_Unit (Hiroshi Urabe)
October 28, 2017
More Decks by Toro_Unit (Hiroshi Urabe)
See All by Toro_Unit (Hiroshi Urabe)
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
690
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
590
ブロックテーマとこれからの WordPress サイト制作 / nishinomiya.dev@2025-12-21
torounit
1
280
ブロックテーマとこれからの WordPress サイト制作 / Toyama WordPress Meetup Vol.81
torounit
0
810
ブロックテーマ時代における、テーマの CSS について考える Toro_Unit / 2025.09.13 @ Shinshu WordPress Meetup
torounit
0
790
ブロックテーマでサイトリニューアルした話 / Toro_Unit / 2025.04.12 @ Shinshu WordPress Meetup
torounit
1
340
Cloudflare Meetup Nagano Vol.3
torounit
1
170
僕が考える 「HTML サイトを WordPress にする」話 / 2023-11-05 Kansai WordPress Meetup
torounit
9
8.8k
Cloudflare Pages に入門してみた / 2023-10-14 Cloudflare Meetup Nagano Vol.2
torounit
2
2.3k
Other Decks in Technology
See All in Technology
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
130
protovalidate-es を導入してみた
bengo4com
0
170
プロダクト開発から業務改善コンサルまで。事業全体へ「染み出す」ことで広がるエンジニアの可能性
ham0215
0
110
NAB Show 2026 動画技術関連レポート / NAB Show 2026 Report
cyberagentdevelopers
PRO
0
170
10倍の生産性を実現するAI駆動並列エージェントのすべて
kumaiu
5
1.4k
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
1
230
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
510
データサイエンスを価値につなげるプロジェクト設計 〜 DS一年目が現場で得た気づき 〜
ysd113
1
190
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
880
AAIFに入ってみた ~内から見えるコミュニティ動向~
sato4
0
180
就職⽀援サービスにおけるキャリアアドバイザーのシフトスケジューリング
recruitengineers
PRO
1
140
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
1.1k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Claude Code のすすめ
schroneko
67
230k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
How to build a perfect <img>
jonoalderson
1
5.6k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
380
Game over? The fight for quality and originality in the time of robots
wayneb77
1
200
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Designing Experiences People Love
moore
143
24k
Building an army of robots
kneath
306
46k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
840
Transcript
ݱͰ͑Δ WordPress.orgܝࡌςʔϚͷ ϝιου Toro_Unit @2017.10.28 / WordFes 1
ʮެࣜσΟϨΫτϦͷςʔϚͱɺҊ݅ͰͷςʔϚͬͯผ?ʯ 2
ͦΜͳ͜ͱͳ͍Αʂ 3
Toro_Unit ෦ ߛ (͏Β ͻΖ͠) ϑϦʔϥϯε Frontend Engineer / Web
Designer Plugin and Theme Developer Github: @torounit Twitter: @Toro_Unit Facebook: fb.me/torounit Blog: https://torounit.com 4
5
6
Plugins and Themes. • Custom Post Type Permalinks • Simple
Post Type Permalinks • Powerful Posts Per Page (PPPP) • Responsive Slide • Vanilla • and more... 7
Contribution • WordBench ϞσϨʔλʔ • WordCamp Kyoto 2017 ࣮ߦҕһ
• WordCamp Tokyo 2017 Speaker • WordBench.org • VCCW Team • etc... 8
ݝদຊࢢ͔Β͖·ͨ͠ɻ1 • ϫΠϯ͓͍͍͠Αɻ • ͦΖͦΖڶഴ͓͍͍͠Αɻ • ͍͔͓͍͍͢͠Αɻ 1 https://commons.wikimedia.org/wiki/File: 130608_Matsumoto_Castle_Matsumoto_Nagano_pref_Japan02bs4.jpg
Author: 663highland. License: CC BY 2.5 9
WordPress.org ςʔϚσΟ ϨΫτϦܝࡌςʔϚ ͱʁ • https://wordpress.org/themes/ • WordPress ͷཧը໘͔ΒΠϯε τʔϧɾߋ৽͕ग़དྷΔςʔϚୡɻ
• ςʔϚϨϏϡʔΛ௨ա͠ͳ͍ͱܝࡌ Ͱ͖ͳ͍ɻ 10
ςʔϚͷ࡞Γํɻ ެࣜͷυΩϡϝϯςʔγϣϯɻࠓͷͱ͜ Ζӳޠ͔͠ແ͍͚ͲɺίʔυͰͷղઆ ଟ͍ͷͰҙ֎ʹͳΜͱ͔ͳΔɻ • Theme Developer Handbook • https://developer.wordpress.org/
themes/ 11
ςʔϚϨϏϡʔΛ௨Βͳ͍͜ͱɻ • ΤεέʔϓͳͲ͕͞Ε͍ͯͳ͍ɻ੬ऑੑ͕༗ΔϞϊɻ • ϓϥάΠϯςϦτϦʔͷػೳɺϓϥάΠϯͰରԠ͢Δ͖ػ ೳ͕͍ͬͯΔϞϊɻ ༷ʑͳ͖·Γ͕͋Δɻ 12
Required – Theme Review Team • https://make.wordpress.org/themes/handbook/review/ required/ • ຊޠ༁
https://mirucon.github.io/required-ja/ 13
ϓϥάΠϯςϦτϦʔ • https://make.wordpress.org/themes/handbook/review/ required/explanations-and-examples/#plugin-territorys σβΠϯʹؔ࿈͠ͳ͍ػೳΛςʔϚʹؚΊ͍͚ͯͳ͍ɻ 14
ྫ • Analytics·ͨτϥοΩϯάͷαϙʔτ • SEOΦϓγϣϯ • ͓͍߹ΘͤϑΥʔϜ • ඇσβΠϯؔ࿈ͷϝλϘοΫε •
ϦιʔεΩϟογϯά • ཧྖҬͷμογϡϘʔυΟδΣοτ • ΧελϜߘλΠϓͱγϣʔτίʔυ • ιʔγϟϧϝσΟΞͷʮ͖ʯɺʮϑΥϩʔʯɺʮڞ༗ʯϘλϯ 15
͍ͨΜʁ 16
ͪΌΜͱकΔͱޮతͳ։ൃ͕ग़དྷΔɻ ݁ՌతʹָʹͳΔΑɻ 17
ςʔϚΛૄ݁߹ʹͰ͖Δɻ 18
νʔϜͰͷ։ൃʹ͓͚Δɺׂͷ໌֬Խɻ • ͦΕͧΕ͕୯ಠͰ͔ͬ͠Γػೳ͢Εۀ͕͍͢͠ɻ • ػೳA͞ΜɺσβΠϯɾϚʔΫΞοϓB͞Μɺهࣄೖྗ C͞Μɻ • ྫɿςʔϚͷ functions.php ͰΧελϜߘλΠϓΛઃఆ
͢ΔͱͦͷςʔϚΛ༗ޮʹ͠ͳ͍ͱɺهࣄ͕ॻ͚ͳ͍ɻ 19
• ϝϯςφϯεɾվमɾϦχϡʔΞϧ࣌ͷख͕ؒগͳ͍ɻ • @see Hiroshi Urabe, Hiromu Hasegawa: ͦͷઃܭେৎʁແ ཧͷͳ͍WordPressͷઃܭͱߏஙΛߟ͑Δ
| WordPress.tv 20
ͦͷͨΊʹ. 21
Theme Unit Test ςʔϚϢχοτςετ - WordPress Codex ຊޠ൛ WYSIWYG ΤσΟλͰී௨ʹهࣄΛॻ͍ͨ
Βී௨ʹදࣔ͞ΕΔΑ͏ʹͪΌΜͱCSSΛ ॻ͘ɻ • ճΓࠐΈΩϟϓγϣϯ͖ը૾ɺΪϟ ϥϦʔ݁ߏΕ͕ͪɻ • ී௨ͷHTML͕classΛ͚ͣʹɺͪΌ Μͱදࣔग़དྷΕɺςʔϚΛม͑ͯ ͪΌΜͱදࣔͰ͖Δͣɻ 22
WordPressͰग़དྷΔ͜ͱΛͪΌΜͱग़དྷΔΑ͏ʹͭ͘Ζ͏ɻ • WordPressʹඪ४ࡌ͞Ε͍ͯΔͷ͕ͪΌΜͱಈ͘Α͏ʹ ͢Δɻ • υΩϡϝϯςʔγϣϯɺαϙʔτͷίετ͕ݮΔɻ • ຊʹग़དྷΔͬͯॻ͍ͯ͋ΔͷʹɾɾɾͬͯͳΔͷɺ ͍ͮΒ͞ͱγεςϜͷෆ৴ײΛੜΉɻ 23
Theme Check Theme Check — WordPress Plugins 24
νΣοΫ߲ • ίʔσΟϯάϧʔϧ • ΤεέʔϓɾαχλΠζ͞Ε͍ͯͳ͍ • ඇਪͳؔɾςϯϓϨʔτλά • ඞਢͷ class
ͷଘࡏɻ • etc... 25
ཧը໘͔Β͍Ζ͍Ζมߋग़དྷΔΑ͏ ʹ͍ͨ͠ɻ 26
27
The Customize API Theme Options – The Customize API |
Theme Developer Handbook | WordPress Developer Resources ΧελϚΠβʔʹઃఆΛՃ͢ΔAPI. 28
࣮ 29
function my_customize_register( WP_Customize_Manager $wp_customize ) { //ηΫγϣϯͷՃ $wp_customize->add_section( 'jumbotron', array(
'title' => __( 'jumbotron' ), ) ); //ઃఆͷΦϓγϣϯ $wp_customize->add_setting( 'jumbotron_title', array( 'default' => 'Hello World!', 'sanitize_callback' => 'esc_html', )); // ϑΥʔϜͷՃ $wp_customize->add_control( 'jumbotron_title', array( 'section' => 'jumbotron', 'label' => __( 'Jumbotron Title', 'demo' ), )); } add_action( 'customize_register', 'my_customize_register' ); 30
ςϯϓϨʔτͰͷදࣔ <h1> <?php echo esc_html( get_theme_mod( 'jumbotron_title', 'Hello World' )
); ?> </h1> 31
͜Μ͚ͩʂ ΧελϜϑΟʔϧυΑΓ؆୯͡Όͳ͍Ͱ͔͢ʁ 32
DEMO torounit/customizer-demo 33
ͳΜ͔ͬ͞Γ͢Δɻɻ 34
Selective Refresh 35
Selective Refresh ͱ Ajax Λͬͯ෦తʹHTMLΛߋ৽ɻ Selective Refresh in the Customizer
– Make WordPress Core 36
function my_customize_register( WP_Customize_Manager $wp_customize ) { $wp_customize->add_setting( 'jumbotron_lead', array( 'default'
=> '', 'sanitize_callback' => 'esc_html', 'transport' => 'postMessage', // JSͰߋ৽͢ΔΑ͏ʹɻ ) ); $wp_customize->add_control( 'jumbotron_lead', array( 'section' => 'jumbotron', )); //ॻ͖͑ΔHTMLΛઃఆ $wp_customize->selective_refresh->add_partial( 'jumbotron_lead', array( 'selector' => '.jumbotron .lead', 'render_callback' => function() { return get_theme_mod( 'jumbotron_lead' ); }, ) );} add_action( 'customize_register', 'my_customize_register' ); 37
͜ΕͰAJAXͰߋ৽͞ΕΔΑ͏ʹɻ 38
JavaScriptͰૢ࡞ͯ͠ɺߋʹߴʹɻ 39
function my_customize_preview_js() { wp_enqueue_script( 'my-customize-preview', get_template_directory_uri() . '/customize-preview.js', array( 'customize-preview'
), false, true ); } add_action( 'customize_preview_init', 'my_customize_preview_js' ); 40
(function( $ ) { wp.customize( 'jumbotron_lead', function( value ) {
value.bind( function( to ) { $( '.jumbotron .lead' ).text( to ); } ); } ); })( jQuery ); 41
͍Ͳ͜Ζ 42
DEMO torounit/fesdemo ίϯςϯπεϥΠμʔΛςʔϚΧελϚΠβʔͰมߋग़དྷΔΑ͏ ʹɻ 43
• Twentysevnteen ͷτοϓϖʔδͷΧελϚΠζ ΧελϚ ΠβʔͰͷ࣮ɻ • Lightning • s56bouya/nishiki: WordPress
theme Nishiki. • Snow Monkey – 100%GPL ͷϝσΟΞ/ϒϩά͚ WordPress ༗ྉςʔϚ 44
·ͱΊɻ • ܝࡌςʔϚɺීஈͷҊ݅ಉ͡Α͏ʹ࡞ΕΔʂ • ·ͣຊମͷػೳΛͪΌΜͱ͍ͦ͏ɻ • _s σϑΥϧτςʔϚ (
Twenty γϦʔζ ) ΛಡΉͱ͍Ζ͍Ζ ൃݟ͕ଟ͍ɻTheme Development Examples 45
Thanks! Github: @torounit Twitter: @Toro_Unit Facebook: fb.me/torounit Blog: https://torounit.com 46