Created
July 26, 2013 02:32
-
-
Save ChrisCree/6085625 to your computer and use it in GitHub Desktop.
Code for home.php to display only 1 post category on the home page blog.
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 | |
do_action( 'genesis_home' ); | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'wsm_custom_loop' ); | |
function wsm_custom_loop() { | |
global $paged; | |
$args = ( array( | |
'category_in' => 3, // ID of category to be displayed | |
'ignore_sticky_posts' => 1, | |
'paged' => $paged, | |
'posts_per_page' => 10, | |
) ); | |
genesis_custom_loop( $args ); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a better option. Just drop this into your functions.php file instead: