Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Grid Content
- * Change the number of words in excerpt if in the grid loop
- */
- function kat_grid_content() {
- // First, we make sure we're in the grid loop.
- if( ! apply_filters( 'is_genesis_grid_loop', false ) )
- return;
- // Change length if teaser
- if( in_array( 'teaser', get_post_class() ) )
- $length = 25;
- else
- $length = 55;
- echo '<p>' . wp_trim_words( get_the_excerpt(), $length ) . '</p>';
- // Display more link
- echo '... <a class="more-link" href="' . get_permalink() . '">Continue Reading</a>';
- // Remove default content so we don't get both
- remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
- }
- add_action( 'genesis_entry_content', 'kat_grid_content', 9 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement