aldolat / posts-in-sidebar

Publish a list of posts in your sidebar
https://dev.aldolat.it/projects/posts-in-sidebar/
GNU General Public License v3.0
16 stars 8 forks source link

Use <!--more--> tag #4

Closed EvertVd closed 10 years ago

EvertVd commented 11 years ago

Currently the tag is ignored and an automated excerpt is generated based on a number of words in the settings. I changed some code in 'posts-in-sidebar.php' at line 262 so it will first try to use the tag, and if it is not available it will generate based on word-count:

$excerpt_text = strip_shortcodes( $linked_posts->post->post_content ); $testformore= strpos($excerpt_text, ""); if ($testformore !== false) { $excerpt_text = substr($excerpt_text, 0, $testformore); } else { $excerpt_text = wp_trim_words( $excerpt_text, $exc_length, '…' ); } echo apply_filters( 'pis_excerpt_text', $excerpt_text );

aldolat commented 10 years ago

Hi EvertVd, I'm very sorry for reading only now your proposal - I wasn't "watching" my issues on github.

Your suggestion has been accepted and implemented in this way: the user can choose if to use an excerpt up to the "more" tag or the excerpt as used until now.

Thanks!