-
AuthorPosts
-
July 19, 2019 at 2:46 am #1120044
Hi Guys, I need to change the SHOP text that appears on the Title of the Breadcrumb bar when I perform a search on woocommerce widget of my site.
For example, if my search URL is /?s=XXXXX
The title on the breadcrumbs will show Results for: XXXXX
But if I search with the widget: /?s=XXXXX&post_type=product
The title on the breadcrumb shows SHOP …
Thanks a lot !
July 19, 2019 at 4:35 pm #1120260Hey LUISCANAL,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaJuly 23, 2019 at 2:08 pm #1121204Hi Victoria !! Sure thing, below site info
July 24, 2019 at 7:56 am #1121403Hi,
Thank you for the update.
You can probably use the “avf_title_args” to adjust the title when the post_type query is set. A few example of its usage can be found in these threads.
// https://kriesi.at/support/topic/how-do-i-display-the-field-title-instead-of-blog-in-article/#post-1112584
// https://kriesi.at/support/topic/force-product-title-to-use-h1-tag-when-using-advanced-layout-builder/#post-1110520Best regards,
IsmaelJuly 25, 2019 at 5:39 am #1121815Sorry, I’m not a programmer, I tried that and does not remove the Tienda (Shop) title on search results …
If I search for https://subastando.online/?s=tra&post_type=product shows Tienda, and I need to show in the Breadcrumb Title Bar: Results for your search XXX
Could you please help me ?
Thanks
LuisJuly 26, 2019 at 3:43 am #1122032Hi,
Thank you for the update.
You can add this code in the functions.php file.
function avf_title_args_mod_product_post_type( $args, $id ) { if ( $_GET['s'] && $_GET['post_type'] == 'product' ) { global $wp_query; if(!empty($wp_query->found_posts)) { if($wp_query->found_posts > 1) { $args['title'] = $wp_query->found_posts ." ". __('search results for:','avia_framework')." ".esc_attr( get_search_query() ); } else { $args['title'] = $wp_query->found_posts ." ". __('search result for:','avia_framework')." ".esc_attr( get_search_query() ); } } else { if(!empty($_GET['s'])) { $args['title'] = __('Search results for:','avia_framework')." ".esc_attr( get_search_query() ); } else { $args['title'] = __('To search the site please enter a valid term','avia_framework'); } } } return $args; } add_filter('avf_title_args', 'avf_title_args_mod_product_post_type', 10, 2);
Best regards,
IsmaelJuly 26, 2019 at 5:27 pm #1122191Worked like a charm ! Best support ever !!
Thanks IsmaelJuly 27, 2019 at 8:09 am #1122274 -
AuthorPosts
- You must be logged in to reply to this topic.