[SOLVED] %WP_searchQuery% displays the search query x-amount of times

Hi,

When building a search result page (exactly following https://www.youtube.com/watch?v=7C_mrJZbrM8&list=PL3sUK5sm14KLZKQncri61upeqz0ycAi4s&index=9) , I get an odd behaviour:

The search query term is displayed x-amount of times, depending on the amount of results. So if you have 2 items, the search term is posted twice, if you have 6, the search term is displayed 6 times below eachother.

You can see this live on https:/brechtryckaert.com, which I’m currently using as a testing ground. Just type “wordpress” or “hack” in the search field and watch as the results page appears with duplicated title/search term.

Anyone encountered this behaviour before? Anyone knows a fix?

Also just updated to 6.1.5 and re-exported, but the behaviour remains. So no luck with updating to the most recent version.

Is your search query title inside of the post loop ?

No in a separate bloc above it. I also checked the generated PHP code, but don’t see any duplications there (at first sight).

I’ve sent the generated theme and bloc-file as a DM :wink:

1 Like

Check the column the title is placed within make sure it’s not set as a loop container.

I’ll take a look tomorrow.

1 Like

This was it :slight_smile: Thanks :pray:

2 Likes