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
クライアントワークのオリジナルテーマ制作
Search
Masahiro NAKASHIMA
November 02, 2019
Programming
1
640
クライアントワークのオリジナルテーマ制作
WordCamp Tokyo 2019 セッション。「クライアントワークのオリジナルテーマ制作 〜実務でのWebサイト構築の抑えどころ〜」の資料です。
Masahiro NAKASHIMA
November 02, 2019
Tweet
Share
More Decks by Masahiro NAKASHIMA
See All by Masahiro NAKASHIMA
コロナの時代の WEBサービス 〜WordPressで実現するプラグインや機能の実装〜
kanakogi
0
580
ページビルダーツールを使った「コードを書かない」サイト制作
kanakogi
1
270
Other Decks in Programming
See All in Programming
CSC509 Lecture 08
javiergs
PRO
0
230
Google Opalで使える37のライブラリ
mickey_kubo
3
130
Cursorハンズオン実践!
eltociear
2
1.2k
AI Agent 時代的開發者生存指南
eddie
4
2.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
170
CSC305 Lecture 06
javiergs
PRO
0
270
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
180
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
4
160
One Enishi After Another
snoozer05
PRO
0
150
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.1k
Range on Rails ―「多重範囲型」という新たな選択肢が、複雑ロジックを劇的にシンプルにしたワケ
rizap_tech
0
6.7k
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
530
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Typedesign – Prime Four
hannesfritz
42
2.8k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Transcript
None
Profile தౡਅ༸ʢφΧγϚϚαώϩʣ ผ໊ϖϯΪϯ 5XJUUFS!LBOBLPHJ 8&#ܥΤϯδχΞɾσβΠφʔ ۠ӋͱϛϟϯϚʔͰࣄ
Profile 8PSE1SFTT ࣄͷݱͰαοͱ͑ΔσβΠϯڭՊॻ ग़൛ٕज़ධࣾ )5.-$44શେࣄయ ग़൛ٕज़ධࣾ
Profile • WP CSV Exporter • WP Theme Test •
Adjust Admin Categories • WP Taxonomy Import • Check Copy ContentsʢCCCʣ ...߹ܭ11ϓϥάΠϯ
Profile ΠϚίί 2005 2019 ϑϦʔͷ8&#σβΠφʔ .PWBCMF5ZQF 8PSE1SFTT )5.-$44 1)1 +BWB4DSJQU
2012 ࣄͷׂ߹ σβΠϯ ϑϩϯτΤϯυ 1)1 8PSE1SFTTؔ
ͣͬͱ ΫϥΠΞϯτϫʔΫ ͬͯ·͢
͓ͬͯ͘ͱ ݱͰʹཱͭ5*14
ཧόʔͷ ѹతଘࡏײ
Admin Bar Position
ຊ൪αʔόʔͰ ςʔϚΛςετ͍ͨ͠
WP Theme Test
ߘϖʔδͷ ΞʔΧΠϒ͕ͳ͍
WP Post Has Archive
"VUIPSϖʔδͷอޢ
wp-login.php
function author_page_redirect() { if( is_author() ) { wp_redirect( home_url()); exit;
} } add_action( 'template_redirect', 'author_page_redirect' ); functions.php
Yoast SEO
ϒϩοΫΤσΟλʔ
ศརͳػೳ
ϚʔΫμϯ͕͑Δ
ϒϩοΫͷίϐʔ͕Ͱ͖Δ
࠶ར༻ϒϩοΫ
ཧը໘ͱ ελΠϧΛ͋ΘͤΔ
ཧը໘ͱελΠϧΛ͋ΘͤΔ ϑϩϯτ ཧը໘
function my_editor_suport() { add_theme_support( 'editor-styles' ); add_editor_style( 'assets/css/editor-style.css' ); }
add_action( 'after_setup_theme', 'my_editor_suport' ); functions.php
h2 { font-size: 24px; color: #70462E; } strong { color:
#70462E; font-weight: bold; } em { font-style: italic; font-weight: bold; } editor-style.css ←ཁૉηϨΫλͰࢦఆ
.content h2 { font-size: 24px; color: #70462E; } .content strong
{ color: #70462E; font-weight: bold; } .content em { font-style: italic; font-weight: bold; } styles.css singular.php <div class=“content”> <?php the_content() ?> </div>
ཧը໘ͱελΠϧΛ͋ΘͤΔ TUZMFTDTT FEJUPSTUZMFDTT ࣅͨΑ͏ͳهड़͕ॏෳͯ͠͠·͏
TBTTσΟϨΫτϦ DTTσΟϨΫτϦ σΟϨΫτϦߏ TUZMFTDTT FEJUPSTUZMFDTT TUZMFTTDTT FEJUPSTUZMFTDTT @DPOpHTDTT DPNQPOFOUTσΟϨΫτϦ @DPOUFOUTDTT
@IPHFTDTT
@import “_config"; h2 { font-size: 24px; color: #70462E; } strong
{ color: #70462E; font-weight: bold; } em { font-style: italic; font-weight: bold; } editor-style.scss styles.scss @import “_config"; @import "components/_content"; components/ _content.scss .content { @import "../editor-style.scss"; }
σΟϨΫτϦߏ TUZMFTDTT FEJUPSTUZMFTDTT @DPOpHTDTT DPNQPOFOUTσΟϨΫτϦ @DPOUFOUTDTT ཧը໘ʹ༻ʹهड़ @IPHFTDTT classͷதʹimport
ϒϩοΫΛ ΧελϚΠζ
࠷৽هࣄͷߘ
Advanced Posts Blocks
UIFNF UFNQMBUFQBSUT CMPDLT BEWBODFEQPTUTCMPDLT QPTUQIQ σΟϨΫτϦߏ QPTUTQIQ DIJMESFOQIQ ෳߘϒϩοΫɹɹtemplate-parts/blocks/advanced-posts-blocks/posts.php ݸผߘϒϩοΫɹɹtemplate-parts/blocks/advanced-posts-blocks/post.php
ࢠߘϒϩοΫɹɹɹtemplate-parts/blocks/advanced-posts-blocks/children.php
template-parts/blocks/advanced-posts-blocks/posts.php <div class="row"> <?php if ( $query->have_posts() ) : ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?> <div class="col-md-4"> <article <?php post_class('news'); ?>> <div class="news_pic"> <?php the_post_thumbnail('medium'); ?> </div> <h2><?php the_title(); ?></h2> </article> </div> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php endif; ?> </div>
ϒϩοΫΛ࡞Δ
Block Lab
1.blocks/{name}/preview.php 2.blocks/preview-{name}.php 3.blocks/preview.php 4.blocks/{name}/block.php 5.blocks/block-{name}.php 6.blocks/block.php Block Lab ͷςϯϓϨʔτ֊
ϒϩοΫΤσΟλʔ࣌ͷ σβΠϯ
ϒϩοΫΛѲͨ͠ σβΠϯ
ϫʔΫϑϩʔ σβΠϯ )5.- 8PSE1SFTT ϫΠϠʔ ϫΠϠʔ ʢϒϩοΫΤσΟλʔʣ σβΠϯ )5.- աڈʹͭͬͨ͘ϒϩοΫΛར༻ɺ
ඞཁ࠷ݶͷ)5.-੍࡞ 8PSE1SFTT աڈʹͭͬͨ͘ϒϩοΫΛར༻ɺ ඞཁ࠷ݶͷϒϩοΫ੍࡞ ͜Ε·Ͱ ϒϩοΫΤσΟλʔ ϫΠϠʔ ʢϒϩοΫΤσΟλʔʣ σβΠϯ ϔομʔɺϑολʔͳͲ )5.- ඞཁ࠷ݶͷ)5.-੍࡞ 8PSE1SFTT ඞཁ࠷ݶͷϒϩοΫ੍࡞ ϒϩοΫΤσΟλʔ ରԠςʔϚ
ϒϩοΫΛࢿ࢈ʹ͢Δ
͍͞͝ʹ
%FNPDSBUJ[F1VCMJTIJOH ύϒϦογϯάͷຽओԽ
XPSEQSFTT 8PSEQSFTT 8PSE1SFTT º º ˓ ϫʔυϓϨεͷਖ਼͍͠௲Γ
ΟυΡε Οτε Οζ ϫΠζ ϫΠυ XJEUIͷಡΈํ
ࣝͷౕྴʹͳΒͳ͍ ࣝΛ*OQVUͨ͜͠ͱͰၗຫʹͳΓ ৽͍͠ػձΛଛࣦ͢Δ
ͭͳ͛Δɻ
5IBOLT