Make WordPress Core

Opened 17 months ago

Last modified 3 weeks ago

#63513 new defect (bug)

Twenty Twenty-Five: Copy for query loop results is confusing on the home page

Reported by: onemaggie Owned by:
Priority: normal Milestone: Awaiting Review
Component: Bundled Theme Version:
Severity: normal Keywords: has-screenshots has-test-info needs-copy-review has-patch has-unit-tests
Cc: Focuses:

Description (last modified by onemaggie)

On the home page of the theme the wording for when the query block has no posts is referring to search results and prompting you to choose different keywords. This doesn't make sense outside of the search results template and it's confusing for users. We should change to a more generic text or simply duplicate the pattern for both use cases

To test, go to the Site Editor and select the Blog home template, scroll all the way to the footer and you'll see the text:

Sorry, but nothing was found. Please try a search with different keywords.

Attachments (1)

image.png​ (132.7 KB ) - added by onemaggie 17 months ago.

Download all attachments as: .zip

Change History (10)

#1 @ravigadhiyawp
17 months ago

  • Keywords reporter-feedback needs-test-info needs-screenshots added

@onemaggie can you please add the screenshot, github link added by you showing 404 github page. Also, write the clear steps for testing.

#2 @onemaggie
17 months ago

  • Description modified (diff)

#3 @onemaggie
17 months ago

#63512 was marked as a duplicate.

#4 @ravigadhiyawp
17 months ago

  • Keywords dev-feedback has-screenshots added; reporter-feedback needs-test-info needs-screenshots removed

#5 @parthvataliya
17 months ago

  • Keywords has-test-info added

Bug Report

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.26
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.4.4 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 136.0.0.0
  • OS: Linux
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Steps to Reproduce

  1. Activate Twenty Twenty Five theme
  2. Go to the site editor.
  3. Choose blog home template
  4. Scroll down and check the text
    Sorry, but nothing was found. Please try a search with different keywords.
    

Additional Notes

As per my suggestion, we should add the text: No content found. Please check back later or try a different search. This message is suitable for situations where no posts are found in the Query Block or search results.

#6 @SirLouen
17 months ago

  • Keywords needs-copy-review added; dev-feedback removed

#7 @369work
6 weeks ago

I looked into where this message comes from in Twenty Twenty-Five.

Environment

  • WordPress: 7.1.2
  • Subdirectory: No
  • PHP: 8.4.25
  • Server: PHP/8.4.25 (Development Server)
  • Database: WP_MySQL_On_SQLite (Server: 8.0.38-mysql-on-sqlite-3.0.2 / Client: 3.53.4)
  • Browser: Edge 153.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.5
  • MU Plugins:
    • 99-studio-loader.php
  • Plugins:
    • Test Reports 1.3.1

Findings

  • The same string, "Sorry, but nothing was found. Please try a search with different keywords.", appears in 19 places across 10 pattern files.
  • All of them use the same translation context: "Message explaining that there are no results returned from a search."
  • template-query-loop.php is shared by four templates: home.html, index.html, archive.html, and search.html.
  • The other 9 pattern files (template-home-*, template-query-loop-*-blog, page-portfolio-home.php, and hidden-sidebar.php) are not referenced directly by any file in the templates folder.

Because template-query-loop.php is used for both the search results page and the other pages, changing the message in only one place will always leave one of them with a message that doesn't fit. Keeping the search wording doesn't fit the home and archive pages, and switching to non-search wording doesn't fit the search page. I think this is where the two options mentioned in the ticket (a generic message, or separate patterns) come from.

The other 9 patterns seem to be offered as choices when switching templates or inserting patterns, although I haven't confirmed this. None of them are search-specific, so the search wording doesn't seem to fit wherever they are used.

I can see three approaches, A, B, and C, with three possible wordings for each.

A: Use one message everywhere (including the search results page)

  • A-1: "Sorry, but nothing was found."
    • The current message without the part about searching. It makes sense on any page.
  • A-2: "No posts were found."
    • This is the message used in Twenty Twenty-Four's hidden-no-results.php, so it would be consistent across the default block themes.
    • Twenty Twenty-Four (1.6) already uses this message everywhere, including the search results page. search.html, index.html, and archive.html all use posts-3-col, which loads hidden-no-results inside its no-results block.
  • A-3: "No content found. Please check back later or try a different search."

B: Keep the current message only on the search results page (with a separate pattern for the search template)

A new hidden pattern for search.html would be created, based on template-query-loop.php, and the current message "Sorry, but nothing was found. Please try a search with different keywords." would stay there. search.html would load that new pattern instead.

Then all 19 instances in the existing 10 pattern files (including template-query-loop.php) would be replaced with one of these:

  • B-1: "Sorry, but nothing was found."
    • Matches the first sentence of the search message.
  • B-2: "No posts were found."
    • Consistent with Twenty Twenty-Four.
  • B-3: "It seems we can't find what you're looking for. Perhaps searching can help."
    • Used in Twenty Twenty-One's content-none.php for pages other than search results. It points visitors to search when nothing is found.

C: Follow the Twenty Twenty-Four approach (move the message into a single hidden pattern)

In Twenty Twenty-Four, the message lives only in hidden-no-results.php, and five patterns load it with <!-- wp:pattern {"slug":"twentytwentyfour/hidden-no-results"} /-->. Twenty Twenty-Five could do the same: move the 19 messages into one hidden pattern and load it from each pattern. The search results page would also show the same message, so the wording options are the same as in A.

  • C-1: "Sorry, but nothing was found."
    • Same as A-1.
  • C-2: "No posts were found."
    • Same as A-2. Both the structure and the wording would match Twenty Twenty-Four.
  • C-3: "No content found. Please check back later or try a different search."
    • Same as A-3.

The difference from A is that any future change to the message would only need to be made in one place, instead of 19. On the other hand, it adds one more pattern file.

With any of these approaches, the translation context for the non-search message would probably need to be updated too, since it currently mentions search.

That's all I have to suggest.

#8 @karmatosed
3 weeks ago

  • Keywords needs-patch added

Thank you all for your contributions so far. The search wording should stay on the search page only. On the home page and the other pages, it does not make sense to ask for different keywords.

I would use “No posts were found.” everywhere else. That matches Twenty Twenty-Four, and it is clear when there are no posts.

This ticket was mentioned in ​PR #14653 on ​WordPress/wordpress-develop by ​@irozum.


3 weeks ago
#9

  • Keywords has-patch has-unit-tests added; needs-patch removed

Description

On the Blog home template, Twenty Twenty-Five shows "Sorry, but nothing was found. Please try a search with different keywords." when the query has no posts. Asking for different keywords only makes sense on search results.

  • The shared template-query-loop pattern (used by index, home and archive) now says "No posts were found.", matching Twenty Twenty-Four, as suggested in the ticket.
  • A new hidden template-query-loop-search pattern keeps the original search wording, and search.html uses it.
  • The home-only patterns (template-home-news-blog, template-home-with-sidebar-news-blog, template-home-posts-grid-news-blog, page-portfolio-home) get the same generic copy.
  • The *-blog pattern variants shared between search and home are left unchanged and can be handled separately.

Testing

  • In the Site Editor, open the Blog home template and scroll to the footer: the empty-query text should read "No posts were found."
  • Visit a search with no matches (/?s=zzzzzz): the text should still ask for different keywords.
  • npm run test:php -- --filter Tests_Theme_TwentyTwentyFiveNoResultsCopy

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Implementation, tests, and PR description.

This Pull Request is for code review only. Please do not merge it on GitHub, as all commits must be made to SVN.

🤖 Generated with ​Claude Code

Note: See TracTickets for help on using tickets.