Skip Navigation

[Resolved] Search title above custom search results

This thread is resolved. Here is a description of the problem and solution.

Problem:

Display URL parameter value with shortcode.

Solution:

You can use shortcode [wpv-search-term].

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

This support ticket is created 2 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 3 voices.

Last updated by a.R 2 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#2273315

a.R

I use

[wpv-conditional if="( '[wpv-search-term param="wpv_view_count"]' eq '' )"]
  <h2>[wpv-search-term param='searchtitle']</h2>
  [/wpv-conditional]

to display a search title (question) above the search results.
This title should disappear, when the user changes search criteria, so we check for wpv_view_count.

Unfortunately, though, when scrolling down the infinite search, the searchtitle will also disappear.

Is there a way now to change that?

So:
Searchtitle should disappear, when user chages search criteria.
Searchtitle should STAY when scrolling down.

THANK YOU 🙂

#2274029

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Because infinite scrolling appends new results to the existing results it uses a different form of querying than conventional pagination (whether paginating via page updates or ajax) and so the test for whether a user has applied any filters (using the wpv_view_count) cannot be depended on in this scenario.

You can change your pagination settings to conventional paginating through pages of results, via ajax, and that should work.

#2274313

a.R

I tried placing the

<h2>[wpv-search-term param='searchtitle']</h2>

ABOVE the VIEW output, it doesn´t work so far.
Is there a way to do that?

#2274711
search-term.jpg

Hello,

I have tried it in my localhost, you can put those shortcode in section "Loop Editor", outside shortcodes [wpv-items-found]...[/wpv-items-found]

See my screenshot search-term.jpg

It works fine in my localhost with infinite scrolling pagination

#2274887

a.R

It didn´t work with us.
Solved that now by moving the search title outside the view by jquery.

Thank you 🙂