How to remove "..." before Read More in excerpt

I am running X Theme with Integrity Stack. On the home (blog) page, I have limited the excerpt content to 0 characters, and changed the “read more” link to a button.

  1. How can I remove the … showing up before “read more” button?

I pasted the following into my child theme functions.php, but did not see any change.

// Excerpt More String
// =============================================================================

if ( ! function_exists( ‘x_excerpt_string’ ) ) :
function x_excerpt_string( $more ) {

$stack = x_get_stack();

if ( $stack == 'integrity' ) {
  return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
} else if ( $stack == 'renew' ) {
  return ' <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
} else if ( $stack == 'icon' ) {
  return ' ...';
} else if ( $stack == 'ethos' ) {
  return ' ...';
}

}
add_filter( ‘excerpt_more’, ‘x_excerpt_string’ );
endif;

  1. How can I change the words “read more” in the button to something else?

Hi There,

Would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:

  • Link to your site
  • WordPress Admin username / password

Thanks.

I included the secure note in the first post.

Hello There,

Thanks for updating in! I have inspected your site and I don’t see any change in the code. You haven’t remove the ... so I went ahead and remove it instead. The final code should be:

// Excerpt More String
// =============================================================================

if ( ! function_exists( 'x_excerpt_string' ) ) :
  function x_excerpt_string( $more ) {
    
    $stack = x_get_stack();

    if ( $stack == 'integrity' ) {
      return '<div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
    } else if ( $stack == 'renew' ) {
      return ' <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
    } else if ( $stack == 'icon' ) {
      return ' ...';
    } else if ( $stack == 'ethos' ) {
      return ' ...';
    }

  }
  add_filter( 'excerpt_more', 'x_excerpt_string' );
endif;

The very first one, since you are using Integrity stack no longer has the .... If you want to change the “Read more” to something else, you may do so. After hitting the save button, since you have installed WP Super Cache, you will need to clear your plugin cache first before testing your site.

Hope this helps.

1 Like

That’s perfect! Thank you so much!

You’re welcome

Hello. I visited this post because I have the same problem and would like to remove the “…” showing up before “read more” button. But I was not able to apply the info on this page. Could you please look at my blog at https://sajigroup.com/blog and help remove it?

Thank you.

Hi There,

Did you add the code suggested here: https://theme.co/apex/forum/t/how-to-remove-before-read-more-in-excerpt/10039/4?

Since you are using integrity stack, that should work for you. Try removing the following CSS that hides the excerpt:

.blog .entry-content.excerpt {
    display: none;
}

Then clear cache and check again.

Hi Lely,
Thanks for the suggestion. I added

.blog .entry-content.excerpt {
display: none;
}

to the CSS editor. It removed the … and the Read more link.

Is there a way to keep the Read More link?

Thank you again.

Hi again,

It looks like you’ve added the above code again, please remove it and remove the previous addition as well.Then add the following code in your Child Theme’s functions.php file:

// Excerpt More String
// =============================================================================

if ( ! function_exists( 'x_excerpt_string' ) ) :
  function x_excerpt_string( $more ) {
    
    $stack = x_get_stack();

    if ( $stack == 'integrity' ) {
      return '<div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
    } else if ( $stack == 'renew' ) {
      return ' <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
    } else if ( $stack == 'icon' ) {
      return ' ...';
    } else if ( $stack == 'ethos' ) {
      return ' ...';
    }

  }
  add_filter( 'excerpt_more', 'x_excerpt_string' );
endif;

Make sure to purge all cache after adding the code. Let us know how this goes!

Hi Nabeel, I’m not sure I know how to do this. Can you please help?

Hi There @mastars

Please open up a new thread and provide your login credentials in a secure note to check your issue.

Make sure to set is as a Secure Note

  • Link to your site
  • WordPress Admin username / password
  • FTP credentials

Thanks!