Customize the_excerpt link
-
Hi,
I’m trying to add manually my latest posts on my homepage and customize their excerpt link (“continue reading”)
I did it using :
<?php $postslist = get_posts('numberposts=2&order=DESC&orderby=date'); foreach ($postslist as $post) : setup_postdata($post); ?>
adding thumbnails and metas and, finally, using
<?php the_excerpt(); ?>
.Ideally, I’d like the last link to be customized exactly as it is in my category page, not made by me, (basically a block text with a border), so I had a look at it to see what happens there and I found a couple of things:
1) My category template uses
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
which is normal, I think, and2) A function was added to functions.php:
add_filter('excerpt_more', 'custom_excerpt_more'); // no more jumping for read more link function no_more_jumping($post) { return '...<a href="'.get_permalink($post->ID).'" class="read-more">'.'Continue Reading'.'</a>'; }
which adds to it the “read-more” class which customizes it.
How can I apply this category also to my homepage excerpt?
Thank you!
- The topic ‘Customize the_excerpt link’ is closed to new replies.