Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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 !

    #1120260

    Hey LUISCANAL,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1121204

    Hi Victoria !! Sure thing, below site info

    #1121403

    Hi,

    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-1110520

    Best regards,
    Ismael

    #1121815

    Sorry, 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
    Luis

    #1122032

    Hi,

    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,
    Ismael

    #1122191

    Worked like a charm ! Best support ever !!
    Thanks Ismael

    #1122274

    Hi,

    Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.