Add Read more link to post grid manual excerpt

Hi, I’ve tried to add Read more link to Visual Composer post grid for manual excerpt using this code:

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>';
    }
  }
  add_filter( 'excerpt_more', 'x_excerpt_string' );
endif;

But Read more doesn’t appear next to manual excerpt. Can you help me achieve this?

This is the page where you can see the manual excerpt without Read more link https://lesgomines.it/attivita-per-tutti/

Thank you very much

Hello Alessandro,

Thanks for writing in!

Please have your code updated and use this instead:

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

    if ( $stack == 'integrity' ) {
      return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read more', '__x__' ) . '</a>';
    }
  }
  add_filter( 'excerpt_more', 'x_excerpt_string' );
endif;

We would loved to know if this has work for you. Thank you.

Thanks, but no, it doesn’t work https://lesgomines.it/attivita-per-tutti/

Hello Alessandro,

Please be advised that when you add a manual excerpt, there will be no read more link to display. Please remove the manual excerpts and the read more links will display.

Hope this helps. Please let us know how it goes.

I’ve need the manual excerpt for another part of the website

I have tried to use subtiles plugin for The Grid elements, but without success.

So, I know when I add a manual excerpt there’s no Read more link, in fact I’m asking for a way to add it to manual excerpt.

Thank you very much

Hi,

If you are adding manual excerpt, you need to add Read more link together with your excerpt.

For example.


Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
<a href="https://lesgomines.it/rifugio-lavarella/">...Read more </a>

https://www.w3schools.com/html/html_links.asp

Hope this helps

I have not thought to this as simple as useful solution because I’m searching for an instruction that generates automatically “Read more” link as happen with automatic excerpt.

Apart this, thank you so much. If will be an automated solution for this case, let me know.

Thanks

Hello Alessandro,

When the automatic excerpt is displayed, the read more link should display because there is already a code for. When you add a manual excerpt, the read more link will not show. Adding the link manually as suggested by Paul should do it then.

Regards.

Yes, yes it’s clear. For now I’ve used the solution suggested by Paul.

Thanks!

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.