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
160
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
2k
2014 WordCamp Phoenix - 30 Days in the WordPress Codex
nicolea
1
110
Other Decks in Programming
See All in Programming
Deep dive into the select statement (GopherCon UK)
jespino
0
160
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.4k
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
190
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
730
業務時間外もAIに働いてもらう話
colorful12
3
9.7k
源内ハンズオン概要編
hideg
0
240
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
250
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
280
Flow は今どうなっているか
mizdra
PRO
0
820
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
130
AIの中の人になってみる
htkym
0
150
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
430
Designing for Performance
lara
611
70k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
For a Future-Friendly Web
brad_frost
183
10k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
460
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
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