Last active
January 18, 2021 17:01
-
-
Save danielpataki/a3c6faec08535bfcb82d to your computer and use it in GitHub Desktop.
Custom Page Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Alphabetical Posts | |
*/ | |
get_header(); ?> | |
<div id="main-content" class="main-content"> | |
<?php | |
if ( is_front_page() && twentyfourteen_has_featured_posts() ) { | |
// Include the featured content template. | |
get_template_part( 'featured-content' ); | |
} | |
?> | |
<div id="primary" class="content-area"> | |
<div id="content" class="site-content" role="main"> | |
<?php | |
$custom_posts = new WP_Query( array( | |
'order_by' => 'title', | |
'order' => 'asc' | |
)); | |
if ( $custom_posts->have_posts() ) : | |
while ( $custom_posts->have_posts() ) : $custom_posts->the_post(); | |
get_template_part( 'content', get_post_format() ); | |
endwhile; | |
twentyfourteen_paging_nav(); | |
else : | |
get_template_part( 'content', 'none' ); | |
endif; | |
?> | |
</div><!-- #content --> | |
</div><!-- #primary --> | |
</div><!-- #main-content --> | |
<?php | |
get_sidebar(); | |
get_footer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: My Awesome Custom Page | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Stats Page | |
*/ | |
?> | |
<h1>Hello There</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$custom_posts = new WP_Query( array( | |
'order_by' => get_field( 'order_by' ), | |
'order' => get_field( 'order' ) | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Custom Post List | |
*/ | |
get_header(); ?> | |
<div id="main-content" class="main-content"> | |
<?php | |
if ( is_front_page() && twentyfourteen_has_featured_posts() ) { | |
// Include the featured content template. | |
get_template_part( 'featured-content' ); | |
} | |
?> | |
<div id="primary" class="content-area"> | |
<div id="content" class="site-content" role="main"> | |
<h1>Hello There</h1> | |
</div><!-- #content --> | |
</div><!-- #primary --> | |
</div><!-- #main-content --> | |
<?php | |
get_sidebar(); | |
get_footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment