This string is registered in a .PO file for multilingual purposes so it can be translated, so any plugin which checks the strings of .PO files inside the theme and can change/replace them could work, but we mostly recommend Loco Translate. Manually changing the string is not possible and not recommended.
To translate or rename theme strings, you can do this via Loco Translateplugin. If you don't have it, please install and activate the plugin on your WordPress site.
Click "New Language" for the currently active theme (if you didn't created it yet, otherwise ignore this step). On the new language page, choose these options – Screenshot
After that, you will be redirected to the editing screen for theme translations. Before you continue with your translations make sure the current language of your site is selected – Screenshot
Follow these instructions to learn how to translate strings – Screenshot
The changes will be applied immediately – Screenshot
Note: Translation files will be saved to wp-content/themes/{theme-name}/languages folder or global directory of theme translations: wp-content/languages/themes/ (based on your choice).
If you have saved your translations inside the theme folder, always save a backup of languages/ folder (inside the theme) when there is a new theme update. After you update the theme (languages folder will be replaced with an empty folder), just move the backup files you previously saved to the same languages directory and your changes will still be applied.
One more question – and maybe it is too much customisation but I ask anyway – I need the search bar to be able to search product category and tags. Is there a line of code you could share with me to achieve this? Currently I know it can search words in the product name and description. Or if you could consider for the next theme update.
By default, WordPress does not include product categories and tags in its search functionality. The standard search only covers product titles and descriptions. However, there are ways to extend this functionality to include product categories and tags such as using 3rd party plugins, some of them are:
Relevanssi
SearchWP
WooCommerce Product Search
But they have not been tested by us so I am not sure if they work properly with Kalium.
Another way is by adding a custom code to the functions.php file of the child theme:
function custom_search_query( $query ) {
if ( ! is_admin() && $query->is_search && $query->is_main_query() ) {
// Include product post type
$query->set( 'post_type', 'product' );
// Include product categories and tags in the search
$tax_query = array(
'relation' => 'OR',
array(
'taxonomy' => 'product_cat',
'field' => 'name',
'terms' => $query->query_vars['s'],
'operator' => 'LIKE',
),
array(
'taxonomy' => 'product_tag',
'field' => 'name',
'terms' => $query->query_vars['s'],
'operator' => 'LIKE',
),
);
$query->set( 'tax_query', $tax_query );
}
}
add_action( 'pre_get_posts', 'custom_search_query' );
I am not sure if this works, by doing a little research I found it so I hope it works out for you.
Hi, I am using the theme's search bar. Is there a way to change the placeholder "search site..." text (or is installing Loco Translate the only way?)
Hi there,
This string is registered in a .PO file for multilingual purposes so it can be translated, so any plugin which checks the strings of .PO files inside the theme and can change/replace them could work, but we mostly recommend Loco Translate. Manually changing the string is not possible and not recommended.
Best regards,
Laborator Team
Understood thank you.
What are the steps in Loco? Do I edit template of theme or add new language in child?
Hi again,
To translate or rename theme strings, you can do this via Loco Translate plugin. If you don't have it, please install and activate the plugin on your WordPress site.
Note: Translation files will be saved to wp-content/themes/{theme-name}/languages folder or global directory of theme translations: wp-content/languages/themes/ (based on your choice).
If you have saved your translations inside the theme folder, always save a backup of languages/ folder (inside the theme) when there is a new theme update. After you update the theme (languages folder will be replaced with an empty folder), just move the backup files you previously saved to the same languages directory and your changes will still be applied.
Best regards,
Laborator Team
Thanks so much Art, all clear!
One more question – and maybe it is too much customisation but I ask anyway – I need the search bar to be able to search product category and tags. Is there a line of code you could share with me to achieve this? Currently I know it can search words in the product name and description. Or if you could consider for the next theme update.
Appreciate your help very much. Have a great day
Hi again,
By default, WordPress does not include product categories and tags in its search functionality. The standard search only covers product titles and descriptions. However, there are ways to extend this functionality to include product categories and tags such as using 3rd party plugins, some of them are:
But they have not been tested by us so I am not sure if they work properly with Kalium.
Another way is by adding a custom code to the functions.php file of the child theme:
I am not sure if this works, by doing a little research I found it so I hope it works out for you.
Best regards,
Laborator Team