I want to be able to display various excerpt length, and different read more buttons that will say: "really? found out more" and "get more info" to different sections of the same page.
So far I found out from the wordpress codex that I can define excerpt length but I haven't been able to use it the right way :(
I defined custom excerpt length in my functions.php like this:
//Adds custom excerpt length
function custom_excerpt_length( $length ) {
return 15;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
But when I add this to my desired section on the page the length of the excerpt affects to the whole page. This is my section's code:
<div class="col-md-6">
<span class="dark-text"><?php the_excerpt('custom_excerpt_length'); ?></span>
</div>
How can I use that custom excerpt length just here and use one of my read more buttons from the beginning of my question?
Thanks guys!