Forum Replies Created
-
AuthorPosts
-
January 25, 2014 at 4:32 am in reply to: Genesis Grid Loop in use, but "read more" links disappear! #86935bigrelativeMember
i am using the grid loop plugin and two custom functions i'm inserting via the "functions" area of the dynamic custom:
// Add Read More Link to Excerpts
add_filter('excerpt_more', 'get_read_more_link');
add_filter( 'the_content_more_link', 'get_read_more_link' );
function get_read_more_link() {
return '... [mehr lesen]';
}
/**
* Grid Content
* Change the number of words in excerpt if in the grid loop
*/
function be_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 = 30;echo '<p>' . wp_trim_words( get_the_excerpt(), $length ) . '</p>';
// Remove default content so we don't get both
remove_action( 'genesis_post_content', 'genesis_do_post_content' ); // For Genesis 1.x
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); // For Genesis 2.x
}
add_action( 'genesis_post_content', 'be_grid_content', 9 ); // for Genesis 1.x
add_action( 'genesis_entry_content', 'be_grid_content', 9 ); // For Genesis 2.xthe read more links appear as long i do not shorten the excerpts with this code:
/**
* Grid Content
* Change the number of words in excerpt if in the grid loop
*/
function be_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 = 30;echo '<p>' . wp_trim_words( get_the_excerpt(), $length ) . '</p>';
// Remove default content so we don't get both
remove_action( 'genesis_post_content', 'genesis_do_post_content' ); // For Genesis 1.x
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); // For Genesis 2.x
}
add_action( 'genesis_post_content', 'be_grid_content', 9 ); // for Genesis 1.x
add_action( 'genesis_entry_content', 'be_grid_content', 9 ); // For Genesis 2.xas soon as i try to customize the length of the excerpt the read more links disappear. what can i do?
-
AuthorPosts