Created
January 24, 2014 01:10
-
-
Save ChrisCree/8590220 to your computer and use it in GitHub Desktop.
Here's how to display full categories for specified category archives while having excerpts as the default. Add this code below to the functions.php file of your child theme.
This file contains hidden or 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 not copy opening PHP tag | |
// Display full content only for specified categories | |
add_action( 'genesis_before_loop', 'wsm_full_content_category_archive' ); | |
/* | |
* Replace your-category with the slug for your category. | |
* If you wish to display full post content on multiple categories then | |
* separate the slugs with commas like this: | |
* 'your-category', 'your-other-category' | |
* | |
*/ | |
function wsm_full_content_category_archive() { | |
$full_categories = array( 'your-category' ); | |
if ( is_category( $full_categories ) ) { | |
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); | |
add_action( 'genesis_entry_content', 'wsm_do_category_content' ); | |
} | |
} | |
function wsm_do_category_content() { | |
the_content(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment