• So I just started using the Zinnias Lite theme. I went into the CSS and changed the

    <?php the_content(); ?>
    to

    <?php the_excerpt); ?>

    so that entire posts would not show on the home page. Now I cannot figure out how to add a “read more” or “continue reading” button to the bottom of the excerpt so that it is easy to just continue reading.

    I tried editing the post and inserting a read more tag and that did not work it just appeared as white blank space.

    here is a link to my website: https://www.SmartAndSimplistic.com

    I cannot find any answers, I do not want to start over with a new phone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Peninah

    (@highlight_creative)

    Is there a reason why you don’t leave it as the_content, but add “read more” tags into your post content?

    Also, it sounds like you may not be using a child theme. If you’re not, you’ll want to read up on them if you plan to edit your theme. This link is to one of many tutorials available if you search.

    Hi smartandsimplistic,
    Write following code in functions.php file

    function cedcommerce_excerpt_more( $more ) {
    
     $link = sprintf( '<a href="%1$s" class="more-link"><button>%2$s</button></a>',
       esc_url( get_permalink( get_the_ID() ) ),
       sprintf( __( 'Continue reading' ))
     );
     return ' &hellip; ' . $link;
    }
    
    add_filter( 'excerpt_more', 'cedcommerce_excerpt_more' );

    It will add a continue reading button after excerpt
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How To Add A Continue Reading Button’ is closed to new replies.