Forked from robneu/full-content-archives-genesis.php
Last active
December 30, 2015 00:09
Pretty much the same as Rob's original code, but changed the conditional for a custom post type archive.
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 | |
add_action( 'genesis_before_loop', 'prefix_full_content_specific_cpt' ); | |
/** | |
* Filter the output of specific CPT archives so that they display the full | |
* content regarldess of what's selected in the Genesis theme options panel. | |
* | |
* @author FAT Media <http://youneedfat.com>, Carrie Dils <http://www.carriedils.com> | |
* @copyright Copyright (c) 2013, FAT Media, LLC | |
* @license GPL-2.0+ | |
* @uses is_post_type_archive <http://codex.wordpress.org/Function_Reference/is_post_type_archive> | |
* @todo change 'prefix' to the theme prefix. | |
*/ | |
function prefix_full_content_specific_cpt() { | |
$all_cpts = array( 'your-cpt' ); | |
if ( is_post_type_archive( $all_cpts ) ) { | |
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'prefix_no_post_image' ); | |
add_filter( 'genesis_pre_get_option_content_archive', 'prefix_do_full_content' ); | |
add_filter( 'genesis_pre_get_option_content_archive_limit', 'prefix_no_content_limit' ); | |
} | |
} | |
/** | |
* Prevent the featured image from being loaded twice. | |
* | |
* @todo change 'prefix' to the theme prefix. | |
*/ | |
function prefix_no_post_image() { | |
return '0'; | |
} | |
/** | |
* Set the content archives to full. | |
* | |
* @todo change 'prefix' to the theme prefix. | |
*/ | |
function prefix_do_full_content() { | |
return 'full'; | |
} | |
/** | |
* Make sure the content limit isn't set. | |
* | |
* @todo change 'prefix' to the theme prefix. | |
*/ | |
function prefix_no_content_limit() { | |
return '0'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment