Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query block duplicate "read more" link #38373

Closed
draganescu opened this issue Jan 31, 2022 · 7 comments
Closed

Query block duplicate "read more" link #38373

draganescu opened this issue Jan 31, 2022 · 7 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended

Comments

@draganescu
Copy link
Contributor

Description

When using a classic theme (e.g. Twenty Fifteen) and using a posts list block in a post (for example to create an index to related content in a category), one can end up with duplicated read more links:

Step-by-step reproduction instructions

  1. Have WordPress 5.9
  2. Go to Appearance > Themes
  3. Activate Twenty Fifteen
  4. Make a post with an excerpt and content, set it to a category
  5. Make a post without an excerpt but with content, set it to the category at 4
  6. In a new post insert a Posts List block
  7. Setup the block to show the category you used at 4 and 5
  8. Check that order by is Newest to oldest
  9. Notice bug: the post without excerpt will show "continue reading". If one adds a read more link text in the Post List block, the posts with no excerpt will get a duplicated link.

Screenshots, screen recording, code snippet

Screen Shot 2022-01-31 at 14 18 58

Environment info

WordPress 5.9
Gutenberg trunk

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@draganescu draganescu added [Type] Bug An existing feature does not function as intended [Block] Query Loop Affects the Query Loop Block labels Jan 31, 2022
@carolinan
Copy link
Contributor

carolinan commented Jan 31, 2022

I believe this has been brought up before, but it is difficult to search the GitHub repo, so I don't have the link ready right now.

Twenty Fifteen adds the following code:

			the_content(
				sprintf(
					/* translators: %s: Post title. */
					__( 'Continue reading %s', 'twentyfifteen' ),
					the_title( '<span class="screen-reader-text">', '</span>', false )
				)
			);

I don't know how the block could be made aware of that 🤔.

@draganescu
Copy link
Contributor Author

I did search as well but could not find something as well.

@ntsekouras
Copy link
Contributor

I think this would be very hard to detect as is the case for similar php filters and the consistency between editor and front end. A similar case for Post Excerpt was this one: #33366.

@draganescu
Copy link
Contributor Author

Random idea to check if the excerpt ends in an anchor. :)

@draganescu
Copy link
Contributor Author

This is likely to never get a fix (see #38748) as the solutions would be very fragile and the situation is very exotic.

@draganescu draganescu closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2022
@ntsekouras
Copy link
Contributor

I have a POC from a while ago with another approach. It could use some feedback/thoughts 😄

@draganescu
Copy link
Contributor Author

@ntsekouras is #38662 more likely to solve #22269 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants