Opened 16 years ago
Closed 16 years ago
#9103 closed defect (bug) (fixed)
Put search string into <title> of search results page
Reported by: | jidanni | Owned by: | westi |
---|---|---|---|
Milestone: | 2.8 | Priority: | lowest |
Severity: | trivial | Version: | 2.7 |
Component: | Template | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description (last modified by )
WordPress (or at least its default theme) should consider putting the
search string into the XHTML <title> of the search results page.
The goal is to make different searches findable in one's browser
history, etc.
Consider this MediaWiki example:
http://en.wikipedia.org/wiki/Special:Search?search=jidanni
gives
<title>jidanni - Search results - Wikipedia, the free encyclopedia</title>
(Of course one should properly escape the search string, to prevent
XSS.)
Attachments (1)
Change History (9)
#2
@
16 years ago
- Keywords has-patch needs-testing added
- Milestone set to 2.8
Not too sure on the translation front, The other option is:
$title = __('Search Results') . $t_sep . wp_specialchars($search);
#4
@
16 years ago
Also note the search string should be to the very left, as Google and MediaWiki do, or else there is little chance it will be visible in a browser tab, thus all search result tabs will just look the same.
Also consider taking the string produced for the <title> and reusing it in <h2>.
#5
@
16 years ago
Also note the search string should be to the very left
WordPress includes a option for Right to Left, or Left to right ordering of the title options.
By default, It'll be Blog Title => Major => Minor
(minor being the tag, or the search term), If you pass 'right' to 3rd param, It'll be Minor => Major => Blog Title
I dont think the default theme shows the search term.. I know my custom one does, So it completely skiped my mind.
#6
follow-up:
↓ 7
@
16 years ago
I believe I'm trying to say: instead of your diff's
$title = sprintf(__('Search Results %s %s'), $t_sep, wp_specialchars($search));
You should do
$title = sprintf(__('%s %s Search Results'), wp_specialchars($search), $t_sep,);
As Google and Wikipedia do. Else you will have munched 75% of each tab
with "Search Results". Better still would be
$title = sprintf(__('%s %s Search'), wp_specialchars($search), $t_sep,);
Mine are for a totally "leftist" solution.
It seems your original should also be retained, to provide for an additional totally "rightest" choice.
#7
in reply to:
↑ 6
@
16 years ago
- Cc westi added
- Description modified (diff)
- Owner changed from anonymous to westi
- Status changed from new to assigned
Replying to jidanni:
I believe I'm trying to say: instead of your diff's
$title = sprintf(__('Search Results %s %s'), $t_sep, wp_specialchars($search));You should do
$title = sprintf(__('%s %s Search Results'), wp_specialchars($search), $t_sep,);As Google and Wikipedia do. Else you will have munched 75% of each tab
with "Search Results". Better still would be
$title = sprintf(__('%s %s Search'), wp_specialchars($search), $t_sep,);Mine are for a totally "leftist" solution.
It seems your original should also be retained, to provide for an additional totally "rightest" choice.
Nope the diffs are correct.
WordPress is by default leftist.
If you want rightist you call wp_title in your theme with the third argument as 'right' and it flips them all round for you.
This is exactly how the default and classic themes do it.
Same with Google, http://www.google.com/search?q=movie+ideas gives