admin管理员组文章数量:1287792
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.
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.
Share Improve this question edited Oct 8, 2021 at 9:05 Rup 4,4004 gold badges29 silver badges29 bronze badges asked Oct 8, 2021 at 8:49 Richard GrahnRichard Grahn 52 bronze badges 1 |1 Answer
Reset to default 0There 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.
本文标签: What code in the WP Sinatra theme generates the words “Read More”
版权声明:本文标题:What code in the WP Sinatra theme generates the words “Read More?” 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741279556a2369927.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
<!--more-->
tag? – Jacob Peattie Commented Oct 9, 2021 at 7:17