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
Jetpack for Theme Developers (wcmtl)
Search
Kelly Dwan
July 05, 2015
Technology
3.2k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jetpack for Theme Developers (wcmtl)
Kelly Dwan
July 05, 2015
More Decks by Kelly Dwan
See All by Kelly Dwan
React-ing to WordPress (WCNYC '16)
ryelle
1
870
Jetpack for Theme Developers
ryelle
2
200
Other Decks in Technology
See All in Technology
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
0
140
実装だけじゃない! CCA-F取得エンジニアが教えるClaude Code開発プロセス活用術
diggymo
2
650
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
0
150
Kaggleで成長するために意識したこと
prgckwb
2
310
Claude Code公式skillで 自分の仕事を少しずつ手放そう!(Claude Code開発ノウハウ大公開スペシャル by クラスメソッド)
kaym
1
280
ZOZOTOWNの進化と信頼性を両立する負荷試験
zozotech
PRO
2
160
オブザーバビリティ、本当に活用できてる? 〜API連携×生成AIで成熟度を自動評価〜
dmmsre
1
3.1k
ゼロをイチにする仕事が終わったあと
smasato
0
340
AI駆動開発におけるQAエンジニアの役割事例 〜AI駆動開発の現場から〜
kobayashiyorimitsu
0
500
AI時代のエンジニアキャリアについて今一度考える
sakamoto_582
2
1.5k
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
170
AI Agent SaaS を支える自社仮想化基盤への挑戦と実運用 / ai-agent-saas-virtualization
flatt_security
2
3.8k
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
850
Fireside Chat
paigeccino
42
4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
220
WCS-LA-2024
lcolladotor
0
680
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
460
We Have a Design System, Now What?
morganepeng
55
8.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Crafting Experiences
bethany
1
210
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
330
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
220
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.4k
Transcript
@ryelle #wcmtl JETPACK FOR DEVELOPERS
@ryelle #wcmtl WANT TO FOLLOW ALONG? http://redradar.net/wcmtl-2015
http://redradar.net/wcmtl-2015
@ryelle #wcmtl http://redradar.net/wcmtl-2015
None
@ryelle #wcmtl DEVELOPMENT ENVIRONMENT
</> JETPACK_DEV_DEBUG jetpack_development_mode wp-config.php or functions.php
@ryelle #wcmtl PROGRESSIVE ENHANCEMENT
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> add_theme_support( 'title-tag' ); $background = array( 'default-color' => '71af3a', ); add_theme_support( 'custom-background', $background ); add_theme_support
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $args = array( 'function' => 'prefix_my_function', ); add_theme_support( 'custom-feature', $args ); function prefix_my_function( $maybe_args ) { // Do some code here. // echo or return as needed. } callbacks
None
@ryelle #wcmtl INFINITE SCROLL
Museum
None
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'infinite-scroll', array( 'type' => 'click', 'container' => 'main', 'posts_per_page' => 12, 'footer' => 'page', 'render' => 'prefix_is_render', ) ); } function prefix_is_render() { // Only needed if your loop is different than while( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; } jetpack.php
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'infinite-scroll', array( 'type' => 'click', 'container' => 'main', 'posts_per_page' => 12, 'footer' => 'page', 'render' => 'prefix_is_render', ) ); } function prefix_is_render() { // Only needed if your loop is different than while( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; } jetpack.php
http://jetpack.me/support/infinite-scroll/
@ryelle #wcmtl FEATURED CONTENT
Twenty Fourteen
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'featured-content', array( 'filter' => 'prefix_get_featured_content', 'max_posts' => 6, 'post_types' => array( 'post' ), ) ); } function prefix_get_featured_posts(){ return apply_filters( 'prefix_get_featured_content', array() ); } jetpack.php
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'featured-content', array( 'filter' => 'prefix_get_featured_content', 'max_posts' => 6, 'post_types' => array( 'post' ), ) ); } function prefix_get_featured_posts(){ return apply_filters( 'prefix_get_featured_content', array() ); } jetpack.php
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $featured_posts = prefix_get_featured_posts(); foreach ( $featured_posts as $post ): setup_postdata( $post ); // Include the featured content template. get_template_part( 'content', 'featured' ); endforeach; wp_reset_postdata(); featured-content.php
http://jetpack.me/support/featured-content/
@ryelle #wcmtl PORTFOLIOS
None
None
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'jetpack-portfolio' ); } jetpack.php
None
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> <?php /** * Template Name: Portfolio Page Template * * @package illustratr */ …template code… portfolio-page.php Illustratr
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $posts_per_page = get_option( 'jetpack_portfolio_posts_per_page', '10' ); $args = array( 'post_type' => 'jetpack-portfolio', 'posts_per_page' => $posts_per_page, ); $project_query = new WP_Query( $args ); if ( post_type_exists( 'jetpack-portfolio' ) && $project_query->have_posts() ) : portfolio-page.php Illustratr
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $posts_per_page = get_option( 'jetpack_portfolio_posts_per_page', '10' ); $args = array( 'post_type' => 'jetpack-portfolio', 'posts_per_page' => $posts_per_page, ); $project_query = new WP_Query( $args ); if ( post_type_exists( 'jetpack-portfolio' ) && $project_query->have_posts() ) : portfolio-page.php Illustratr
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $posts_per_page = get_option( 'jetpack_portfolio_posts_per_page', '10' ); $args = array( 'post_type' => 'jetpack-portfolio', 'posts_per_page' => $posts_per_page, ); $project_query = new WP_Query( $args ); if ( post_type_exists( 'jetpack-portfolio' ) && $project_query->have_posts() ) : portfolio-page.php Illustratr
Illustratr
http://jetpack.me/support/custom-content-types/ https://en.support.wordpress.com/portfolios/ portfolio-shortcode/
@ryelle #wcmtl TESTIMONIALS
None
Sela
@ryelle #wcmtl RESTAURANT MENUS
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'nova_menu_item' ); } jetpack.php
None
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $loop = new WP_Query( [ 'post_type' => 'nova_menu_item' ] ); while ( $loop->have_posts() ) : $loop->the_post(); get_template_part( 'content', 'menu' ); endwhile; // end of the Menu Item Loop wp_reset_postdata(); page-menu.php Confit
Confit
Confit
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> Nova_Restaurant::init( array( 'menu_tag' => 'section', 'menu_class' => 'menu-items', 'menu_header_tag' => 'header', 'menu_header_class' => 'menu-group-header', 'menu_title_tag' => 'h1', 'menu_title_class' => 'menu-group-title', 'menu_description_tag' => 'div', 'menu_description_class' => 'menu-group-description', ) ); page-menu.php Confit
/modules/custom-post-types/nova.php
@ryelle #wcmtl HIDDEN TREASURES
@ryelle #wcmtl SITE LOGO
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'site-logo', array( 'size' => 'full', )); } jetpack.php
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> if ( function_exists('jetpack_the_site_logo') ) { jetpack_the_site_logo(); } header.php
Cucina
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_site_logo( $html, $logo, $size ) { // do something with $html return $html; } add_filter( 'jetpack_the_site_logo', 'prefix_site_logo', 10, 3 ); jetpack.php
http://jetpack.me/support/site-logo/
@ryelle #wcmtl BREADCRUMBS
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> <?php if ( function_exists('jetpack_breadcrumbs') ) : ?> <div class="navigation"> <?php jetpack_breadcrumbs(); ?> </div><!-- .navigation --> <?php endif; ?> page.php
None
@ryelle #wcmtl CSS PROCESSING
Umbra
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> if ( ! class_exists( 'Jetpack_Custom_CSS' ) ) { require Jetpack::get_module_path( 'custom-css' ); } $color = get_query_var( 'prefix_color' ); $valid_color = preg_match( '/^[0-9a-f]{6}$/i', $color ); if ( ! $valid_color ) { die(); } $base_sass = file_get_contents('colors.scss'); $sass = '$base-color: #' . $color . '; ' . $base_sass; $css = Jetpack_Custom_CSS::minify( $sass, 'sass' ); header( 'Content-type: text/css; charset: UTF-8' ); echo $css; die(); dynamic-colors.php Umbra
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> if ( ! class_exists( 'Jetpack_Custom_CSS' ) ) { require Jetpack::get_module_path( 'custom-css' ); } $color = get_query_var( 'prefix_color' ); $valid_color = preg_match( '/^[0-9a-f]{6}$/i', $color ); if ( ! $valid_color ) { die(); } $base_sass = file_get_contents('colors.scss'); $sass = '$base-color: #' . $color . '; ' . $base_sass; $css = Jetpack_Custom_CSS::minify( $sass, 'sass' ); header( 'Content-type: text/css; charset: UTF-8' ); echo $css; die(); dynamic-colors.php Umbra
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> if ( ! class_exists( 'Jetpack_Custom_CSS' ) ) { require Jetpack::get_module_path( 'custom-css' ); } $color = get_query_var( 'prefix_color' ); $valid_color = preg_match( '/^[0-9a-f]{6}$/i', $color ); if ( ! $valid_color ) { die(); } $base_sass = file_get_contents('colors.scss'); $sass = '$base-color: #' . $color . '; ' . $base_sass; $css = Jetpack_Custom_CSS::minify( $sass, 'sass' ); header( 'Content-type: text/css; charset: UTF-8' ); echo $css; die(); dynamic-colors.php Umbra
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $base-hue: hue($base-color); $body-background: hsl( $base-hue, 0, 97% ); $text-color: hsl( $base-hue, 4%, 26% ); body { background: $body-background; } body, button, input, select, textarea { color: $text-color; } colors.scss Umbra
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> if ( ! class_exists( 'Jetpack_Custom_CSS' ) ) { require Jetpack::get_module_path( 'custom-css' ); } $color = get_query_var( 'prefix_color' ); $valid_color = preg_match( '/^[0-9a-f]{6}$/i', $color ); if ( ! $valid_color ) { die(); } $base_sass = file_get_contents('colors.scss'); $sass = '$base-color: #' . $color . '; ' . $base_sass; $css = Jetpack_Custom_CSS::minify( $sass, 'sass' ); header( 'Content-type: text/css; charset: UTF-8' ); echo $css; die(); dynamic-colors.php Umbra
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> if ( ! class_exists( 'Jetpack_Custom_CSS' ) ) { require Jetpack::get_module_path( 'custom-css' ); } $color = get_query_var( 'prefix_color' ); $valid_color = preg_match( '/^[0-9a-f]{6}$/i', $color ); if ( ! $valid_color ) { die(); } $base_sass = file_get_contents('colors.scss'); $sass = '$base-color: #' . $color . '; ' . $base_sass; $css = Jetpack_Custom_CSS::minify( $sass, 'sass' ); header( 'Content-type: text/css; charset: UTF-8' ); echo $css; die(); dynamic-colors.php Umbra
@ryelle #wcmtl TONESQUE
Umbra
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> function prefix_jetpack_setup(){ add_theme_support( 'tonesque' ); } functions.php
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $image_src = prefix_get_post_image( $post_id ); if ( ! $image_src ) { return false; } $image = new Tonesque( $image_src ); $color = $image->color(); dynamic-colors.php
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $image_src = prefix_get_post_image( $post_id ); if ( ! $image_src ) { return false; } $image = new Tonesque( $image_src ); $color = $image->color(); dynamic-colors.php
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $image_src = prefix_get_post_image( $post_id ); if ( ! $image_src ) { return false; } $image = new Tonesque( $image_src ); $color = $image->color(); dynamic-colors.php
Color Posts Plugin
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20 </> $image = new Tonesque( $image_src ); $background_color = $image->color(); $contrast = $image->contrast(); dynamic-colors.php
None
@ryelle #wcmtl KEEP IN MIND…
Contact forms Infinite Scroll button Sharing links Lovecraft
@ryelle #wcmtl QUESTIONS?
@ryelle #wcmtl THANKS! http://redradar.net/wcmtl-2015