Archived topic
Drop the "read more" text below excerpt
3 replies · Started by Jerry on January 2, 2021
Hi guys, 2 things I need help with.
I used this to add the "read more" text back on the archive which works great!
add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
function tu_excerpt_metabox_more( $excerpt ) {
$output = $excerpt;
if ( has_excerpt() ) {
$output = sprintf( '%1$s <a href="%2$s">%3$s</a>',
$excerpt,
get_permalink(),
__( 'Read more>>', 'generatepress' )
);
}
return $output;
}
However, I like it drop down 2 lines. Currently, it is in line with the last words of the excerpt. So basically I want to drop it a full line to create a little space.
Secondly, what CSS do I need to make the text bold?
Thank you!
Hi Jerry,
You could try this CSS to move the Read more down and bold the text:
.entry-summary p {
display: flex;
flex-direction: column;
}
.entry-summary p a {
margin-top: 1em; /*adjust the number yourself */
font-weight: bold;
}
Let me know :)
This worked flawlessly, thank you!
Glad to hear that :)