Slide 1

Slide 1 text

ݱ৔Ͱ΋࢖͑Δ WordPress.orgܝࡌςʔϚͷ ϝιου Toro_Unit @2017.10.28 / WordFes 1

Slide 2

Slide 2 text

ʮެࣜσΟϨΫτϦͷςʔϚͱɺҊ݅ͰͷςʔϚͬͯผ෺?ʯ 2

Slide 3

Slide 3 text

ͦΜͳ͜ͱͳ͍Αʂ 3

Slide 4

Slide 4 text

Toro_Unit ઎෦ ߛ (͏Β΂ ͻΖ͠) ϑϦʔϥϯε Frontend Engineer / Web Designer Plugin and Theme Developer Github: @torounit Twitter: @Toro_Unit Facebook: fb.me/torounit Blog: https://torounit.com 4

Slide 5

Slide 5 text

5

Slide 6

Slide 6 text

6

Slide 7

Slide 7 text

Plugins and Themes. • Custom Post Type Permalinks • Simple Post Type Permalinks • Powerful Posts Per Page (PPPP) • Responsive Slide • Vanilla • and more... 7

Slide 8

Slide 8 text

Contribution • WordBench ௕໺ ϞσϨʔλʔ • WordCamp Kyoto 2017 ࣮ߦҕһ • WordCamp Tokyo 2017 Speaker • WordBench.org • VCCW Team • etc... 8

Slide 9

Slide 9 text

௕໺ݝদຊࢢ͔Β͖·ͨ͠ɻ1 • ϫΠϯ͓͍͍͠Αɻ • ͦΖͦΖڶഴ΋͓͍͍͠Αɻ • ͍͔͢΋͓͍͍͠Αɻ 1 https://commons.wikimedia.org/wiki/File: 130608_Matsumoto_Castle_Matsumoto_Nagano_pref_Japan02bs4.jpg Author: 663highland. License: CC BY 2.5 9

Slide 10

Slide 10 text

WordPress.org ςʔϚσΟ ϨΫτϦܝࡌςʔϚ ͱ͸ʁ • https://wordpress.org/themes/ • WordPress ͷ؅ཧը໘͔ΒΠϯε τʔϧɾߋ৽͕ग़དྷΔςʔϚୡɻ • ςʔϚϨϏϡʔΛ௨ա͠ͳ͍ͱܝࡌ Ͱ͖ͳ͍ɻ 10

Slide 11

Slide 11 text

ςʔϚͷ࡞Γํɻ ެࣜͷυΩϡϝϯςʔγϣϯɻࠓͷͱ͜ Ζӳޠ͔͠ແ͍͚ͲɺίʔυͰͷղઆ΋ ଟ͍ͷͰҙ֎ʹͳΜͱ͔ͳΔɻ • Theme Developer Handbook • https://developer.wordpress.org/ themes/ 11

Slide 12

Slide 12 text

ςʔϚϨϏϡʔΛ௨Βͳ͍͜ͱɻ • ΤεέʔϓͳͲ͕͞Ε͍ͯͳ͍ɻ੬ऑੑ͕༗ΔϞϊɻ • ϓϥάΠϯςϦτϦʔͷػೳɺϓϥάΠϯͰରԠ͢Δ΂͖ػ ೳ͕৐͍ͬͯΔϞϊɻ ༷ʑͳ͖·Γ͕͋Δɻ 12

Slide 13

Slide 13 text

Required – Theme Review Team • https://make.wordpress.org/themes/handbook/review/ required/ • ೔ຊޠ༁ https://mirucon.github.io/required-ja/ 13

Slide 14

Slide 14 text

ϓϥάΠϯςϦτϦʔ • https://make.wordpress.org/themes/handbook/review/ required/explanations-and-examples/#plugin-territorys σβΠϯʹؔ࿈͠ͳ͍ػೳΛςʔϚʹؚΊͯ͸͍͚ͳ͍ɻ 14

Slide 15

Slide 15 text

ྫ • Analytics·ͨ͸τϥοΩϯάͷαϙʔτ • SEOΦϓγϣϯ • ͓໰͍߹ΘͤϑΥʔϜ • ඇσβΠϯؔ࿈ͷϝλϘοΫε • ϦιʔεΩϟογϯά • ؅ཧྖҬͷμογϡϘʔυ΢ΟδΣοτ • ΧελϜ౤ߘλΠϓͱγϣʔτίʔυ • ιʔγϟϧϝσΟΞͷʮ޷͖ʯɺʮϑΥϩʔʯɺʮڞ༗ʯϘλϯ 15

Slide 16

Slide 16 text

͍ͨ΁Μʁ 16

Slide 17

Slide 17 text

ͪΌΜͱकΔͱޮ཰తͳ։ൃ͕ग़དྷΔɻ ݁ՌతʹָʹͳΔΑɻ 17

Slide 18

Slide 18 text

ςʔϚΛૄ݁߹ʹͰ͖Δɻ 18

Slide 19

Slide 19 text

νʔϜͰͷ։ൃʹ͓͚Δɺ໾ׂͷ໌֬Խɻ • ͦΕͧΕ͕୯ಠͰ͔ͬ͠Γػೳ͢Ε͹෼ۀ͕͠΍͍͢ɻ • ػೳ͸A͞ΜɺσβΠϯɾϚʔΫΞοϓ͸B͞Μɺهࣄೖྗ͸ C͞Μɻ • ྫɿςʔϚͷ functions.php ͰΧελϜ౤ߘλΠϓΛઃఆ ͢ΔͱͦͷςʔϚΛ༗ޮʹ͠ͳ͍ͱɺهࣄ͕ॻ͚ͳ͍ɻ 19

Slide 20

Slide 20 text

• ϝϯςφϯεɾվमɾϦχϡʔΞϧ࣌ͷख͕ؒগͳ͍ɻ • @see Hiroshi Urabe, Hiromu Hasegawa: ͦͷઃܭେৎ෉ʁແ ཧͷͳ͍WordPressͷઃܭͱߏஙΛߟ͑Δ | WordPress.tv 20

Slide 21

Slide 21 text

ͦͷͨΊʹ. 21

Slide 22

Slide 22 text

Theme Unit Test ςʔϚϢχοτςετ - WordPress Codex ೔ຊޠ൛ WYSIWYG ΤσΟλͰී௨ʹهࣄΛॻ͍ͨ Βී௨ʹදࣔ͞ΕΔΑ͏ʹͪΌΜͱCSSΛ ॻ͘ɻ • ճΓࠐΈ΍Ωϟϓγϣϯ෇͖ը૾ɺΪϟ ϥϦʔ౳݁ߏ๨Ε͕ͪɻ • ී௨ͷHTML͕class౳Λ෇͚ͣʹɺͪΌ Μͱදࣔग़དྷΕ͹ɺςʔϚΛม͑ͯ΋ ͪΌΜͱදࣔͰ͖Δ͸ͣɻ 22

Slide 23

Slide 23 text

WordPressͰग़དྷΔ͜ͱΛͪΌΜͱग़དྷΔΑ͏ʹͭ͘Ζ͏ɻ • WordPressʹඪ४౥ࡌ͞Ε͍ͯΔ΋ͷ͕ͪΌΜͱಈ͘Α͏ʹ ͢Δɻ • υΩϡϝϯςʔγϣϯɺαϙʔτͷίετ͕ݮΔɻ • ຊʹ͸ग़དྷΔͬͯॻ͍ͯ͋ΔͷʹɾɾɾͬͯͳΔͷ͸ɺ࢖ ͍ͮΒ͞ͱγεςϜ΁ͷෆ৴ײΛੜΉɻ 23

Slide 24

Slide 24 text

Theme Check Theme Check — WordPress Plugins 24

Slide 25

Slide 25 text

νΣοΫ߲໨ • ίʔσΟϯάϧʔϧ • ΤεέʔϓɾαχλΠζ͞Ε͍ͯͳ͍஋ • ඇਪ঑ͳؔ਺ɾςϯϓϨʔτλά • ඞਢͷ class ͷଘࡏɻ • etc... 25

Slide 26

Slide 26 text

؅ཧը໘͔Β͍Ζ͍Ζมߋग़དྷΔΑ͏ ʹ͍ͨ͠ɻ 26

Slide 27

Slide 27 text

27

Slide 28

Slide 28 text

The Customize API Theme Options – The Customize API | Theme Developer Handbook | WordPress Developer Resources ΧελϚΠβʔʹઃఆΛ௥Ճ͢ΔAPI. 28

Slide 29

Slide 29 text

࣮૷ 29

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

ςϯϓϨʔτͰͷදࣔ

31

Slide 32

Slide 32 text

͜Μ͚ͩʂ ΧελϜϑΟʔϧυΑΓ؆୯͡Όͳ͍Ͱ͔͢ʁ 32

Slide 33

Slide 33 text

DEMO torounit/customizer-demo 33

Slide 34

Slide 34 text

ͳΜ͔΋ͬ͞Γ͢Δɻɻ 34

Slide 35

Slide 35 text

Selective Refresh 35

Slide 36

Slide 36 text

Selective Refresh ͱ͸ Ajax Λ࢖ͬͯ෦෼తʹHTMLΛߋ৽ɻ Selective Refresh in the Customizer – Make WordPress Core 36

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

͜ΕͰAJAXͰߋ৽͞ΕΔΑ͏ʹɻ 38

Slide 39

Slide 39 text

JavaScriptͰૢ࡞ͯ͠ɺߋʹߴ଎ʹɻ 39

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

(function( $ ) { wp.customize( 'jumbotron_lead', function( value ) { value.bind( function( to ) { $( '.jumbotron .lead' ).text( to ); } ); } ); })( jQuery ); 41

Slide 42

Slide 42 text

࢖͍Ͳ͜Ζ 42

Slide 43

Slide 43 text

DEMO torounit/fesdemo ίϯςϯπεϥΠμʔΛςʔϚΧελϚΠβʔͰมߋग़དྷΔΑ͏ ʹɻ 43

Slide 44

Slide 44 text

• Twentysevnteen ͷτοϓϖʔδͷΧελϚΠζ ΋ΧελϚ ΠβʔͰͷ࣮૷ɻ • Lightning • s56bouya/nishiki: WordPress theme Nishiki. • Snow Monkey – 100%GPL ͷϝσΟΞ/ϒϩά޲͚ WordPress ༗ྉςʔϚ 44

Slide 45

Slide 45 text

·ͱΊɻ • ܝࡌςʔϚ΋ɺීஈͷҊ݅΋ಉ͡Α͏ʹ࡞ΕΔʂ • ·ͣຊମͷػೳΛͪΌΜͱ࢖͍౗ͦ͏ɻ • _s ΍ σϑΥϧτςʔϚ ( Twenty γϦʔζ ) ΛಡΉͱ͍Ζ͍Ζ ൃݟ͕ଟ͍ɻTheme Development Examples 45

Slide 46

Slide 46 text

Thanks! Github: @torounit Twitter: @Toro_Unit Facebook: fb.me/torounit Blog: https://torounit.com 46