Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1168575
    Rad
    Moderator

    Hi there,

    Does it have manually added text excerpt or full content option is enabled in customizer? Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks!

    #1171200
    anthony2483
    Participant

    If I manually add a text excerpt on the post page the read more link doesn’t display.

    If I let the theme create the excerpt as defined in the customizer blog options the read more link works as expected.

    #1171206
    anthony2483
    Participant
    This reply has been marked as private.
    #1172350
    Lely
    Moderator

    Hi There,

    Thank you for the credentials. Please also try adding the following code on your child theme’s functions.php file:

    //Read More Button For Excerpt
    function themprefix_excerpt_read_more_link($output) {
        global $post;
         if( '' != $post->post_excerpt ){
             return empty( $output ) ? $output : $output . ' <a href="' . get_permalink($post->ID) . '" class="more-link" title="Read More">Read More</a>';
         }
    }
    add_filter( 'the_excerpt', 'themprefix_excerpt_read_more_link' );

    Manual excerpt by default doesn’t add read more. Do let us know how this goes.
    Hope this helps.

    #1173216
    anthony2483
    Participant

    This did add the read more link to the post with manual excerpt but it also cleared the regular automatic excerpt and read more link. I think the previous code needs to be combined with the new code. I tried to combine it using an else but I couldn’t get it to work quite right.

    previous code:

    // Read more adjustment
    function remove_x_excerpt_string() {
      remove_filter( 'excerpt_more', 'x_excerpt_string' );
    }
    
    add_filter('after_setup_theme', 'remove_x_excerpt_string');
    
    function new_excerpt_more($more) {
      global $post;
      return ' ... <a href="' . get_permalink() . '">' . __( 'Read More', '__x__' ) . '</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    #1173908
    Jade
    Moderator

    Hi there,

    Please try this:

    // Replaces the excerpt "Read More" text by a link
    function new_excerpt_more($output) {
        global $post;
    
        return empty( $output ) ? $output : $output . ' <a href="' . get_permalink($post->ID) . '" class="more-link" title="Read More">Read More</a>';
    }
    
    add_filter('the_excerpt', 'new_excerpt_more');
    #1175469
    anthony2483
    Participant

    I can work with this but one last thing I can’t figure out is how to center the read more link.

    I’ve tried everything I can think of using the more-link class but maybe I’m doing something wrong.

    I thought this would work

    .more-link { 
      margin: 0 auto;
      width: 100%!important;
    }
    #1175979
    Lely
    Moderator

    Hi There,

    Please try this CSS instead:

    .blog .entry-content.excerpt a {
        text-align: center;
    }
    .blog a.more-link {
        margin: 0 auto;
        display: block;
    }

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1153974 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>