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
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
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
120
OSもどきOS
arkw
0
600
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
980
どこまでゆるくて許されるのか
tk3fftk
0
270
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.4k
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
610
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
これからAgentCoreを触る方へトレンドはGatewayです
har1101
4
390
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
270
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
170
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Exploring anti-patterns in Rails
aemeredith
3
430
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
350
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
55k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
YesSQL, Process and Tooling at Scale
rocio
174
15k
GitHub's CSS Performance
jonrohan
1033
470k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
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