Hi,
Thank you for contacting us and I'd be happy to assist.
To show the selected search term's title and description, you'll need a custom shortcode:
add_shortcode( 'get_term_data_custom', 'get_term_data_custom_func');
function get_term_data_custom_func($atts){
$parameter = $atts['parameter'];
$value = $atts['value'];
$taxonomy = $atts['taxonomy'];
if ( (!empty($parameter)) && (!empty($value)) && (!empty($taxonomy)) && (!empty($_GET[$parameter])) ) {
$category = get_term_by('slug', $_GET[$parameter], $taxonomy, 'ARRAY_A');
if($category) {
switch ($value) {
case 'title':
return $category['name'];
break;
case 'description':
return $category['description'];
break;
}
}
}
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.
This shortcode will get the selected term's slug from the URL and then show its title or description, as requested.
For example, if the taxonomy's slug is "film-category" and the URL parameter used in the search is "category", then to show the selected term's title, you can use:
[get_term_data_custom parameter="category" value="title" taxonomy="film-category"]
And similarly, to show the selected term's description, you'll use:
[get_term_data_custom parameter="category" value="description" taxonomy="film-category"]
Note: To make sure that this shortcode's value is updated every time a different term is selected in the search, you'll need to include it within the "[wpv-filter-controls]...[/wpv-filter-controls]" tags, inside the "Search and Pagination" section.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar