godaddy-wordpress / primer-child-mins

Mins is a Primer child theme with a minimal design.
9 stars 10 forks source link

Reading excerpt length settings not honored #60

Closed EvanHerman closed 6 years ago

EvanHerman commented 6 years ago

Original report: https://wordpress.org/support/topic/blog-not-showing-full-text-in-mins-theme/

The reading settings for the For each article in a feed, show is not honored, and the blog posting page always shows the excerpt length.

One possible solution is to introduce a new helper, min_excerpt, to dictate how to generate the excerpt lengths inside of template/parts/loop/post-excerpt.php (https://github.com/godaddy/wp-mins-theme/blob/develop/templates/parts/loop/post-excerpt.php#L11).

Example:

/**
 * Generate the post excerpts
 *
 * @return string Post excerpt or full content
 */
function mins_excerpt() {

    if ( get_option( 'rss_use_excerpt', 0 ) ) {

        the_excerpt();

        printf(
            '<p><a class="button" href="%1$s">%2$s</a></p>',
            esc_url( get_the_permalink() ),
            esc_html__( 'Continue Reading', 'primer' )
        );

        return;

    }

    the_content();

}
EvanHerman commented 6 years ago

Taking a second look at this, that option is controlling the RSS feed excerpt lengths and not the excerpts on the front of site. The excerpt length can be controlled through the excerpt_length filter or by customizing template/parts/loop/post-excerpt.php.