[wp-trac] [WordPress Trac] #60493: Query loop block: Search Template Issues

WordPress Trac noreply at wordpress.org
Mon Feb 12 12:58:21 UTC 2024


#60493: Query loop block: Search Template Issues
-------------------------------+------------------------------
 Reporter:  rawdolphe          |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  6.4.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by rawdolphe):

 Hi @poena,

 Thanks a lot for your reply.

 Well, I have actually tried with the Category template and it seemed to
 work as it should, but NOT with the Search template.

 No, I am NOT using a custom post. All standard, nothing extra.

 BTW: To clarify further, I have seen videos on YouTube explaining the
 Search options in Twenty Twenty Three and it worked fine! i.e; if you
 choose Posts only it will only show Posts in the search results, but with
 2024 setting it to Posts OR Pages doesn't even work, it seems to do
 NOTHING! That's what I am talking about.

 What I am trying to do is very simple, but maybe I am having trouble
 explaining it, I'll try again:

 Ok, in the 'Search template', in 2024, go to 'Query Loop' then go to
 'Settings', as default it is set to 'Inherit query from template'. When
 you do a search, i.e /?s=any_keyword it will pull anything with the
 keyword, from Posts AND Pages.

 Now, as above, but simple change 'Settings' to 'POST TYPE > Post', Save
 and do a search...
 In my case, it does do anything at all. It looks and feels broken, nothing
 happens. Same if I set it to 'Pages'.

 Now, to confirm to myself that there was a problem with the Search
 template, I installed a free plugin called Ajax Search Lite - to see if I
 could output Posts ONLY from searches; BUT a *very important* step BTW, I
 have make sure that in the 'Search template' the 'Query loop' is set to
 'Inherit query from template', otherwise same problem as explained above
 when set to Posts or Pages only (not both).

 So, after installing Ajax Search lite, I setup the plugin to show Posts
 ONLY, and sure enough, it worked, even with the built-in WordPress Search,
 when I search, it pulls the Posts only. And one important thing to note,
 is that I don't even have to use the Search widget from the Ajaz Search
 Lite plugin, meaning that by simply installing this plugin it fixes the
 issue, as long you set it to display Posts only, or Pages.

 I am very sorry for the very long post, but unless I overlooked something
 simple, as far as I am concerned the 'Search template' in 2024 is broken
 when set to show Posts or Pages it doesn't do anything at all.

 I'll attach a screenshot, please let me know if this setting in the
 'Search template' is supposed to output Posts (and yes I also played with
 the Filters - it made no difference).

 https://snipboard.io/sJ7pDF.jpg

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60493#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list