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
2016 WordCamp Ann Arbor - More Core Functions Y...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Nicole
October 20, 2016
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
2016 WordCamp Ann Arbor - More Core Functions You (Maybe) Don't Know Exist
WordCamp Ann Arbor 2016
Nicole
October 20, 2016
More Decks by Nicole
See All by Nicole
2014 WordCamp Ann Arbor - Core Functions You (Maybe) Don't Know Exist
nicolea
0
190
2014 WordCamp Grand Rapids - Core Functions You (Maybe) Don't Know Exist
nicolea
0
1.9k
2014 WordCamp Phoenix - 30 Days in the WordPress Codex
nicolea
1
110
Other Decks in Programming
See All in Programming
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
540
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
100
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
270
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
120
どこまでゆるくて許されるのか
tk3fftk
0
520
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
530
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
500
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
5.3k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
150
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
430
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
160
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
1
9.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Odyssey Design
rkendrick25
PRO
2
730
First, design no harm
axbom
PRO
2
1.2k
Designing Powerful Visuals for Engaging Learning
tmiket
1
460
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Side Projects
sachag
455
43k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
420
We Are The Robots
honzajavorek
0
280
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
420
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
660
Transcript
Core Functions You (Maybe) Don’t Know Exist @nlarnold1 #WPCoreFunctions www.alleyinteractive.com
@alleydev Presented by Nicole Arnold
the_posts_pagination $args (array) Default pagination arguments. Parameters (string) Displays a
paginated navigation to next/previous set of posts, when applicable. Returns
the_posts_pagination // Previous/next page navigation. twentyfourteen_paging_nav(); Twentyfourteen
the_posts_pagination function twentyfourteen_paging_nav() { global $wp_query, $wp_rewrite; // Don't print
empty markup if there's only one page. if ( $wp_query->max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map( 'urlencode', $query_args ), 'prev_text' => __( '← Previous', 'twentyfourteen' ), 'next_text' => __( 'Next →', 'twentyfourteen' ), ) ); if ( $links ) : ?> <nav class="navigation paging-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentyfourteen' ); ?></h1> <div class="pagination loop-pagination"> <?php echo $links; ?> </div><!-- .pagination --> </nav><!-- .navigation --> <?php endif; } Twentyfourteen
the_posts_pagination Twentyfourteen
the_posts_pagination // Previous/next page navigation. the_posts_pagination( array( 'prev_text' => __(
'Previous page', 'twentyfifteen' ), 'next_text' => __( 'Next page', 'twentyfifteen' ), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', ) ); Twentyfifteen
the_posts_pagination Twentyfourteen using new function
the_post_navigation $args (array) Default post navigation arguments. Parameters (string) Displays
the navigation to next/previous post, when applicable. Returns
the_post_navigation // Previous/next page navigation. twentyfourteen_post_nav(); Twentyfourteen
the_post_navigation function twentyfourteen_post_nav() { // Don't print empty markup if
there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1> <div class="nav-links"> <?php if ( is_attachment() ) : previous_post_link( '%link', __( '<span class="meta-nav">Published In</span>%title', 'twentyfourteen' ) ); else : previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) ); next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) ); endif; ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php } Twentyfourteen
the_post_navigation Twentyfourteen
the_post_navigation // Previous/next page navigation. the_post_navigation( array( 'next_text' => '<span
class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' . '<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' . '<span class="post-title">%title</span>', 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' . '<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' . '<span class="post-title">%title</span>', ) ); Twentyfifteen
the_post_navigation Twentyfourteen using new function
the_archive_title $before (string) (Optional) Content to prepend to the title.
$after (string) (Optional) Content to append to the title. Parameters (string) Display the archive title based on the queried object. Returns
the_archive_title <h1 class="page-title"> <?php if ( is_day() ) : printf(
__( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() ); elseif ( is_month() ) : printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) ) ); elseif ( is_year() ) : printf( __( 'Yearly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyfourteen' ) ) ); else : _e( 'Archives', 'twentyfourteen' ); endif; ?> </h1> Twentyfourteen
the_archive_title Twentyfourteen
the_archive_title the_archive_title( '<h1 class="page-title">', '</h1>' ); Twentyfifteen
the_archive_title Twentyfourteen using new function
Core Functions You (Maybe) Don’t Know Exist @nlarnold1 #WPCoreFunctions www.alleyinteractive.com
@alleydev Presented by Nicole Arnold