Make WordPress Core

Opened 13 months ago

Last modified 13 months ago

#57909 new feature request

It's not logical that the "Read more"-button disappears when you create a manual excerpt

Reported by: hero2's profile hero2 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 1.5
Component: Formatting Keywords: close 2nd-opinion
Focuses: Cc:

Description

When you create a manual excerpt on a Post, the "Read more"-button disappears on the Blog-page. That is NOT logical, if you ask me!
I was told by the Astra Pro Theme support that this is a default behaviour of WordPress.
To me, this is a bug, but formally I guess it's a feature request, to let the user decide whether to have a "Read more"-button or not, and how it should look! And NOT let it depend on whether you have created a manual excerpt for that post!

I will try to add a screen shot which shows that the "Read more"-button is only visible on Post-thumbnails where I have not manually created the excerpt.

Attachments (1)

Astra manual excerpt no 'read more' button.png (311.0 KB) - added by hero2 13 months ago.
Screen shot of Blog-page, showing 2 Post-thumbnails, with and without "Read more"-button

Download all attachments as: .zip

Change History (6)

@hero2
13 months ago

Screen shot of Blog-page, showing 2 Post-thumbnails, with and without "Read more"-button

#1 @costdev
13 months ago

  • Component changed from Post Thumbnails to Formatting
  • Focuses ui removed
  • Keywords close 2nd-opinion added; changes-requested removed
  • Version changed from 6.1.1 to 1.5

Hi @hero2, welcome to Trac and thanks for opening this ticket.

The "More" text/link has only been added for automatically generated excerpts since WordPress 1.5.0 (circa 2005). Code Reference

To add this as the default now should be considered very carefully with respect to backward compatibility, expectations, and theme-specific needs.

Alternatively, you can add the "More" text/link to all excerpts with something like this:

<?php

add_filter( 'wp_trim_excerpt', 'myprefix_add_read_more', 999 );
function myprefix_add_read_more( $text ) {
        $read_more = apply_filters( 'excerpt_more', ' [&hellip;]' );

        if ( ! str_ends_with( $text, $read_more ) ) {
                $text = rtrim( $text ) . $read_more;
        }

        return $text;
}

  • Changing the Version property to 1.5 when this was introduced with wp_trim_excerpt().
  • As this can be achieved using a filter without changing this behaviour on all sites, I'm tentatively adding close for this to be closed as wontfix.
  • However, I'm also adding 2nd-opinion to gather thoughts from others on this.
Last edited 13 months ago by costdev (previous) (diff)

#2 @jakariaistauk
13 months ago

Hi @hero2 ,
Thanks for the ticket. If there is no Read More button a site visitor can not understand that there is more content about this topic. so I think Read More button should add for both manual and automatic excerpts.

#3 follow-up: @hero2
13 months ago

The thing that does not make sense to me is that WP displays Post-items on the Blog-page differently depending on whether there is a manual excerpt or an automatically generated excerpt. That does not make sense.
Instead, it should be the user that switches the "Read more"-button on or off on ALL Post-items at once.

#4 in reply to: ↑ 3 @jakariaistauk
13 months ago

Replying to hero2:

The thing that does not make sense to me is that WP displays Post-items on the Blog-page differently depending on whether there is a manual excerpt or an automatically generated excerpt. That does not make sense.
Instead, it should be the user that switches the "Read more"-button on or off on ALL Post-items at once.

Yes. you are right. I agree with you.

#5 @hero2
13 months ago

On top of that comes the fact that the built-in "Read more"-link is multilingual (using WPML plugin) but the code snippets I have found for re-creating it are NOT... :-(

Note: See TracTickets for help on using tickets.