Skip Navigation

[Resolved] Search displays different excerpts depending on how the search is done.

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

Problem:

The issue here is that the user is displaying is post excerpts on the parametric search but after performing a search the excerpts don't show anymore.

Solution:

In this case the issue was being caused by the user putting a field to search for that was not available on this CPT so it was messing with the view's display.

I would recommend ensuring that the fields that are being searched for are available on the the CPT itself.

This support ticket is created 6 years, 3 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 2 voices.

Last updated by JSG 6 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#604419

JSG
2018-01-08 09_07_50-Coach Search Results - SkillZDr Sports.png
2018-01-08 09_07_19-Coach Search Results - SkillZDr Sports.png

I am trying to: Search my "Directory" custom posts for matching Zip Code (Tag) and Sport (Category)

When I search for only Sport I the results show the maul excerpt which is what I want.

When I search with both Sport and Zip Code (which is a txt search) I receive the standard WP excerpt.

Link to a page where the issue can be seen: hidden link

Question 1
How do I force it to display the manual excerpt.

Question 2
Is there a better way to select the Zip Code Tag then a Text Search. We have 11,000 Zip Codes which makes a drop down not very useful.

Question3

Is there a way to hide all of the results from hidden link if a search is not initiated.

#604514

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for contacting our support forum.

Let me see how best I can assist you with this.

Question 1
How do I force it to display the manual excerpt.

A. Not sure what you mean by manual excerpt, is this the default excerpt field from wordpress that you enter the excerpt in ? If so and you use the [wpv-post-excerpt] in your view output it should always give the results of that shortcode.

Question 2
Is there a better way to select the Zip Code Tag then a Text Search. We have 11,000 Zip Codes which makes a drop down not very useful.

A. The best way is to have the search bar as you have it because it'll be way too robust to use another method. Most search sites i'm aware of uses a text field for the zip code search.

Question3

Is there a way to hide all of the results from hidden link if a search is not initiated.

A. the only way to do this is to have the search results on a separate page. This is the exact setup how you have it on the homepage.

Finally i'm not sure how its giving you another excerpt based on whats searched, however i tried to do the search but it didn't result in anything being found.

Thanks,
Shane

#604517

JSG

Here is a link to the WordPress Codex that explains a Manual Excerpt. https://codex.wordpress.org/Excerpt

In the Screen Shot with the name Donnie N in it that is the output of the manual excerpt. This only displays when only a sport is selected for search.

The 2nd screen shot shows the automatic excerpt and is shown when Sport and Zip Code are used to search.

We want the Manual one to display in all cases as it has HTML code in we want to see.

#604534

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Right so that means you are entering your information in the excerpt field of your post.

Would you mind providing me with admin access to the site so that I can take a deeper look at this for you ?

The private fields have been enabled for your next response.

Thanks,
Shane

#604539
#604549

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for the credentials.

I was able to take a look at this for you on the backend. So the issue with the excerpt is being caused by you search box. Also the search box isn't searching through the taxonomies. We can create a manual search filter using html like this.
<input type="text" name="wpv-wpbdp_tag">

I've added this to your view so it should now be working.

Please let me know if this helps.
Thanks,
Shane

#604554

JSG

So I better understand. <input type="text" name="wpv-wpbdp_tag"> forces the search to only look at wpv-wpbdp_tag .

We are in the planning stages of removing this plugin all together and rebuilding it with ToolSet. I feel it will be a good fit.

#604563

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Yes that is correct.

If you look closely the filter shortcodes essentially generates html form elements on the frontend, so you can specify your field type manually.

The only disadvantage to this is that It doesn't work when you're using AJAX for the filtering.

Thanks,
Shane

#604571

JSG

Thanks much for your help.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.