Hello,
I’ve been trying to adjust the excerpt length on the homepage from 30 to lower but I seem to be struggling with the coding.
function bold_photography_excerpt_length( $length ) {
if ( is_admin() ) {
return $length;
}
// Getting data from Customizer Options
$length = get_theme_mod( 'bold_photography_excerpt_length', 30 );
return absint( $length );
}
endif; //bold_photography_excerpt_length
add_filter( 'excerpt_length', 'bold_photography_excerpt_length', 999 );
if ( ! function_exists( 'bold_photography_excerpt_more' ) ) :
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ... and a option from customizer
*
* @return string option from customizer prepended with an ellipsis.
*/
function bold_photography_excerpt_more( $more ) {
if ( is_admin() ) {
return $more;
}
$more_tag_text = get_theme_mod( 'bold_photography_excerpt_more_text', esc_html__( 'Continue reading...', 'bold-photography' ) );
$link = sprintf( '<p class="more-link"><a href="%1$s" class="readmore">%2$s</a></p>',
esc_url( get_permalink() ),
/* translators: %s: Name of current post */
wp_kses_data( $more_tag_text ). '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>'
);
return $link;
}
endif;
I assume it is from the above part of the .php, but editing it to a lower number doesn’t seem to work for me. Nor do I know where specifically to add anything mentioned here, none work in customiser https://stackoverflow.com/questions/15294164/how-to-get-excerpt-text-to-automatically-cut-off-at-the-bottom-of-a-div
I am looking for code which lowers it, or totally removes it.
Thanks,
Siren