"Read More" Excerpt/Post Entry Placement on X

I would like to know how I can move the Read More link to be at the end of the excerpt instead of being on a new line in X. The stack I am using is “Integrity” not sure if that matters.

Any help would be greatly appreciated!

Example of what I want to achieve:
Lorem ipsum dolor sit amet, summo molestiae consectetuer an ius. Nam ei adhuc commune adversarium. Omnium saperet usu id. Alii aliquip deterruisset ut mel, ad his amet erant, lorem essent duo ne. Cu sed ferri liberavisse …read more

How it is currently:
Lorem ipsum dolor sit amet, summo molestiae consectetuer an ius. Nam ei adhuc commune adversarium. Omnium saperet usu id. Alii aliquip deterruisset ut mel, ad his amet erant, lorem essent duo ne. Cu sed ferri liberavisse.

Read More

Hi,

To achieve that, you can add the code below in your child theme’s functions.php

 function x_excerpt_string( $more ) {
    $stack = x_get_stack();
    if ( $stack == 'integrity' ) {
      return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
    } 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' );

Hope this helps

Thank you so much Paul!, Worked perfectly and was exactly what I needed.

Have a great day,
Cheers!

You’re most welcome!

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