I wish to take away the line break between your paragraph and also the "Find out moreInch. It will continue immediately after the 3 dots. Inside the paragraph. We do hope you understand what i'm saying.

Can you really put the link within the excerpt? Are you able to repair it with css?


$args = array( 'numberposts' => 3 );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); 

<h2 class="news"><?php the_title(); ?></h2>

<?php the_excerpt(); ?>  //this returns the paragraph with three dots

<a href="<?php the_permalink(); ?>">Read more</a>  //this should somehow be inside the excerpt

<?php endforeach; ?>

No, however the fix is straightforward.

Add this line after your foreach():

remove_filter('the_excerpt', 'wpautop');

Now it will stop printing <p> tags.

Inside your style.css, alter the margin from the p tag as 0px.

p {
   margin: 0px;

Inside your stylesheet add this line:

#news p {margin-bottom:0px;}

This can take away the space between your text and also the Find Out More link.

Based on the Wordpress Codex, you could do this this

Place this inside a theme's functions.php to create the "find out moreInch connect to the publish

function new_excerpt_more($more) {
       global $post;
    return '<a href="'. get_permalink($post->ID) . '">Read the Rest...</a>';
add_filter('excerpt_more', 'new_excerpt_more');