Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
現場でも使えるWordPress.org掲載テーマのメソッド
Search
Toro_Unit (Hiroshi Urabe)
October 28, 2017
Technology
3.8k
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
Transcript
46 slides
ݱͰ͑Δ 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
More Decks by Toro_Unit (Hiroshi Urabe)
See All by Toro_Unit (Hiroshi Urabe)
Kansai WordPress Meetup@大阪『ブロックテーマを作る上で知っておくべきこと
torounit
0
310
Gifu WordPress Meetup #200 に向けて、私たちには何ができるだろうか?/ 2026-11-07 Gifu WordPress Meetup
torounit
0
380
WordPress のサイト制作について改めて考える Toro_Unit / 2026.07.25 @ Shinshu WordPress Meetup
torounit
0
250
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
910
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
1k
ブロックテーマとこれからの WordPress サイト制作 / nishinomiya.dev@2025-12-21
torounit
1
320
ブロックテーマとこれからの WordPress サイト制作 / Toyama WordPress Meetup Vol.81
torounit
0
850
ブロックテーマ時代における、テーマの CSS について考える Toro_Unit / 2025.09.13 @ Shinshu WordPress Meetup
torounit
0
1.1k
ブロックテーマでサイトリニューアルした話 / Toro_Unit / 2025.04.12 @ Shinshu WordPress Meetup
torounit
1
390
Other Decks in Technology
See All in Technology
落とし穴にハマってわかった 開発生産性を測るときに気をつけたいこと
munakata
3
490
Go でトランザクション、どう書いてますか?
knwoop
1
580
Taking back control of your AI development
inesmontani
PRO
0
310
共通基盤の実装に Kotlin - Quarkus を選定した理由と採用したアーキテクチャ
nealle
1
160
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
1.1k
HTTP通信に使おうとすると実はめんどくさいfile_get_contents
maguroalternative
0
260
現場に渡し、構造で守る AI エージェントを活用したセルフサーブのデータ基盤の運用
legalontechnologies
PRO
0
110
実測データからサービスの成長余力を測る。負荷シナリオ・テストデータ・限界値の設計
kazatohiei
0
170
みん強Lightning! データ基盤ひとりでできるかな
endonanana
0
190
技術書典で本を売る流れ
yoshimura_datam
0
130
Del vibe coding a un Desarrollo (agéntico) fiable
jcabot
0
220
Is the Website Dying?
miriamschwab
0
160
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
610
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
Google's AI Overviews - The New Search
badams
0
1.7k
Code Review Best Practice
trishagee
74
20k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
630
Bash Introduction
62gerente
615
220k
Practical Orchestrator
shlominoach
192
12k
Test your architecture with Archunit
thirion
2
2.5k
A better future with KSS
kneath
240
18k
Are puppies a ranking factor?
jonoalderson
2
4.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
370
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k