Skip Navigation

[Closed] Displaying conditional content for search query

This support ticket is created 3 years, 4 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1704091

Tell us what you are trying to do? I would like to display different ads depending on the search term selected. I made a test page using several conditional statements, none of them work. I have made the view using content templates and then used the template in a post. There will be multiple searches on each directory page so I will need multiple conditions on each directory page.

I have uploaded the Woo Commerce + Woo Commerce Cred plugins but haven't altered either their or the Toolset settings. Please let me know if I do not need these plugins.

Is there any documentation that you are following? I've spent the past 6 hours looking through your documentation.

Is there a similar example that we can see?

What is the link to your site? hidden link

#1704441


I would like to display different ads depending on the search term selected. I made a test page using several conditional statements, none of them work.

Hello, conditionals are generally intended to analyze the content of the post where the conditional is displayed, or the current post in the loop if placed inside a View's loop. It sounds like you want to use conditionals to determine the terms selected in the search query of a View or WordPress Archive, which is a bit different from the standard use of conditionals. You can use conditionals for this purpose by testing the value of the wpv-search-term shortcode, but the syntax of such a conditional depends on the search query itself so it would be best for me to see the search View on your site and offer some guidance based on the URL parameters for each search filter. Can you share a URL where I can see the custom search? It is not obvious to me based on the link you shared.


I have uploaded the Woo Commerce + Woo Commerce Cred plugins but haven't altered either their or the Toolset settings. Please let me know if I do not need these plugins.

It depends on your site and the features you plan to use. Toolset Forms Commerce is designed to help accomplish two specific things:
1. Require a completed purchase to create/publish a post
2. Require a completed purchase to create a User Profile.
If you don't plan to use these specific features, you can safely delete this plugin without any negative side effects. If you decide you need it in the future, you will be able to reinstall it at any time you have an active subscription.

Toolset WooCommerce Blocks is required for several features, most importantly custom design of the Shop page listings (i.e. a WordPress Archive for the Products post type) and custom design of single Product posts using a Content Template. Without Toolset WooCommerce Blocks installed and active, these two features are not possible. Several WooCommerce-specific shortcodes (https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#woocommerce-views-2) and other features require Toolset WooCommerce Blocks, but it is possible to create a WooCommerce site without ever needing this plugin. You may or may not need it depending on the features you want to implement.

The topic ‘[Closed] Displaying conditional content for search query’ is closed to new replies.