Created
January 15, 2013 16:42
-
-
Save WebEndevSnippets/4539990 to your computer and use it in GitHub Desktop.
Genesis: Page template Novels
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: Novels | |
*/ | |
/** Remove Post Meta and Post Info */ | |
remove_action( 'genesis_before_post_content', 'genesis_post_info' ); | |
remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); | |
/** Add Novels body class */ | |
add_filter( 'body_class', 'we_add_novels_body_class' ); | |
21function we_add_novels_body_class( $classes ) { | |
$classes[] = 'novels published-books'; | |
return $classes; | |
} | |
/** Remove default loop */ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
/** Add Novels custom loop */ | |
add_action( 'genesis_loop', 'we_novels_do_loop' ); | |
function we_novels_do_loop() { | |
global $paged; | |
$mycpt = 'we_published-book'; | |
$posts_per_page = 6; | |
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; | |
$args = array( | |
'post_type' => $mycpt, | |
'posts_per_page' => $posts_per_page, | |
'paged' => $paged, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'we_book-category', | |
'field' => 'id', | |
'terms' => '54' | |
) | |
), | |
); | |
genesis_custom_loop( $args ); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment