0

I’m pulling my hair out. I have searched and searched for a way to remove the “Read More” link from my posts (full post, not excerpt). I’ve tried to add the filter below (and other pieces of code in functions.php) promoted in a number of places on the web. The filter works to turn the excerpt into a full-content post, but the same filter is also supposed to set the Read More text to null. Here’s what I’m using.

/**
 * Redefine sinatra_excerpt function.
 * 
 */
function sinatra_excerpt( $length = null, $more = null ) {
    the_content();
}

This function partially works in that it results in showing the full post rather than just an excerpt. it’s just the $more part that doesn’t work.

For what it’s worth, I have also tried various CSS examples until I’m blue in the face, most utilizing “display:none” on various elements.

I have searched the entire batch of files related to the Sinatra Theme for the string “Read More” and cannot find a single instance of it. If I could find that, I could just replace that with an empty string or otherwise alter the code. Does anyone know where it is?

Note: The posts are being generated on a Category page.

Thanks for any insight you may be able to provide.

1
  • Does your content use the <!--more--> tag? Commented Oct 9, 2021 at 7:17

1 Answer 1

0

There are a few copies of 'Read More' in the files. I think the one you want is in template-parts/entry/entry-summary-footer.php.

However if you look at the code that includes this in content-blog-horizontal:

if ( sinatra_option( 'blog_horizontal_read_more' ) ) {
    get_template_part( 'template-parts/entry/entry-summary-footer' );
}

there's already a config option 'Show Read More Button' to turn this off. I don't know Sinatra to say where to find this in the admin site, but it should be there.

Regardless it's risky to actually edit the theme because any changes you make would get lost when the theme updates. It's safer to use filters / pluggables you set up in a plugin instead (as you've done for the excerpt function?) or a child theme to make changes.

1
  • Thank you, Rup. I was having no luck finding that with Windows 10 File Explorer search feature. I downloaded a third-party search tool and, with a little detective work, was able to find the exact file you mention above. Glad you confirmed that. Just setting that to an empty string did the trick. Whoopie! As for filters, I've tried so many variations, all of which make sense and should work but they don't. I'm going to heed your advice re. creating a child theme. Haven't had much success in the past but will give it a whirl. Also, I was unable to find the admin feature you mention. Commented Oct 9, 2021 at 0:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.