Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikat/be2c6c06ccec13779977 to your computer and use it in GitHub Desktop.
Save srikat/be2c6c06ccec13779977 to your computer and use it in GitHub Desktop.
add_action( 'genesis_before_loop', 'sk_custom_content_display' );
/**
* Show full content for the latest first post on content archives
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/
*/
function sk_custom_content_display() {
// if this is a singular entry or paginated content archive page, exit
if ( is_singular() || is_paged() ) {
return;
}
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'sk_return_zero' );
add_filter( 'genesis_pre_get_option_content_archive', 'sk_return_full' );
add_filter( 'genesis_pre_get_option_content_archive_limit', 'sk_return_zero' );
}
function sk_return_zero() {
global $wp_query;
if ( ( $wp_query->current_post == 0 ) ) {
return '0';
}
}
function sk_return_full() {
global $wp_query;
if ( ( $wp_query->current_post == 0 ) ) {
return 'full';
}
}
add_action( 'genesis_before_loop', 'sk_custom_content_display' );
/**
* Show full content for the latest first post on content archives
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/
*/
function sk_custom_content_display() {
// if this is a singular entry or paginated content archive page, exit
if ( is_singular() || is_paged() ) {
return;
}
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'sk_return_zero' );
add_filter( 'genesis_pre_get_option_content_archive', 'sk_return_full' );
add_filter( 'genesis_pre_get_option_content_archive_limit', 'sk_return_zero' );
add_action( 'genesis_after_entry', 'sk_comments' );
}
function sk_return_zero() {
global $wp_query;
if ( ( $wp_query->current_post == 0 ) ) {
return '0';
}
}
function sk_return_full() {
global $wp_query;
if ( ( $wp_query->current_post == 0 ) ) {
return 'full';
}
}
function sk_comments() {
global $wp_query;
if ( ( $wp_query->current_post != 0 ) ) {
return;
}
// Comments List and Comment Form
// https://twitter.com/rob_neu/status/616842862861271040
global $withcomments;
$temp = $withcomments;
$withcomments = true;
comments_template( '', true );
$withcomments = $temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment