Skip Navigation

[Resolved] Show search result taxonomies

This support ticket is created 7 years, 1 month 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 7 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#580805

Hi,
i would like to show in the result's view of a parametric search a title with the current taxonomies.

I just made it work via the search term like this:

[wpv-conditional if="( '[wpv-search-term param="wpv-zona"]' )"] in zona [wpv-search-term param="wpv-zona"][/wpv-conditional]

In this way it shows the zone from the query term. Is there any better way to implement this type of work ?

#580886

i would like to show in the result's view of a parametric search a title with the current taxonomies.
I assume you mean the taxonomy terms selected in your search form filters, correct? The wpv-search-term shortcode is the best way to access a search form URL parameter using Views shortcodes. You could probably make a more customized display of the terms using a custom shortcode, but what you've got here is probably a good start.

#580894
  • You could probably make a more customized display of the terms using a custom shortcode
  • How can i make a more customized display of terms?
    what do you mean?

    may i have an example ?

    thank you

    #580901

    How can i make a more customized display of terms?
    You can make it using custom PHP code, possibly a custom shortcode. If you're not aware of how to use the WordPress Shortcode API, you may need the assistance of a professional developer.
    https://codex.wordpress.org/Shortcode_API

    what do you mean?
    I mean if you want to display anything other than the defaults provided by wpv-search-term inside the conditional, you may need to write custom code which converts the defaults into something else. If you're satisfied with the default text provided in the conditional by wpv-search-term, you can disregard this.

    may i have an example ?
    Let's say you wanted to display something other than the search term as it's written in the URL. You could write a custom shortcode called "formatted_search_term" and use it like so:

    [wpv-conditional if="( '[wpv-search-term param="wpv-zona"]' )"] 
      [formatted_search_term term='[wpv-searchterm param="wpv-zona"]']
    [/wpv-conditional]
    

    The shortcode PHP would use a similar format to this example:

    add_shortcode( 'formatted_search_term', 'formatted_search_term_func');
    function formatted_search_term_func($atts)
    {
      $term = $atts['term'];
      // your custom code here that converts $term into the variable $formatted
      return $formatted;
    }