Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Created January 6, 2016 20:42
Show Gist options
  • Select an option

  • Save eri-trabiccolo/7b02e5e52bea2d5f45ea to your computer and use it in GitHub Desktop.

Select an option

Save eri-trabiccolo/7b02e5e52bea2d5f45ea to your computer and use it in GitHub Desktop.
Post list: Full length text along with post thumbnails
//first of all disable the grid in the contexts where we want the full length
add_filter('tc_is_grid_enabled', 'show_post_in_full_length' );
//force showing the full length text
add_filter('tc_show_excerpt' , 'show_post_in_full_length');
//force showing the thumb (if it exists)
add_filter('tc_show_thumb' , 'show_thumb_in_post_list_full_length');
function show_post_in_full_length($bool) {
if ( ! is_home() )
return $bool;//<= if current context is not home
//then use the global option set in Appearance > Customize > Pages & Posts layout
return false;//<= else set to false to display the full post content
}
function show_thumb_in_post_list_full_length( $bool ){
return ! is_home() ? $bool : true && method_exists('TC_post_thumbnails', 'tc_has_thumb') && TC_post_thumbnails::$instance -> tc_has_thumb();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment