Hi Movin,
can I change the text within the nav-search (placeholder)? I’d like to change ‘Search’ to, let’s say, ‘Pretraga’.
I understand that the code can be found inside the Theme Header (header.php), but it seems that there is some sort of a filter added.
<div class="nav-search"><?php
add_filter('get_search_form', 'activello_header_search_filter',10,3);
echo get_search_form();
remove_filter('get_search_form', 'activello_header_search_filter');?>
</div>
I found this https://themes.trac.wordpress.org/changeset/56706/activello/1.0.2/header.php?old=56436&old_path=activello%2F1.0.1%2Fheader.php and relized that the header.php was changed. Inside the old code, I would just change (‘Search’, ‘activello’) to (‘whatever I like’, ‘activelo’) here
<input type="text" name="s" placeholder="<?php echo esc_attr_x( __('Search', 'activello'), 'search placeholder', 'activello' ); ?>">
Right?
I’m looking for an easy way, so I don’t have to bother translating the theme.
Oh, and btw the web address is http://www.agenda.rs/
Aleksandar
movin
March 17, 2016, 12:55pm
2
Hi Aleksandar,
I hope you are well today and thank you for your question.
I visited your shared site and found you are not using the theme Activello on your site so just want to know that whether you want a solution for Activello theme or any other theme.
Please advise.
Best Regards,
Movin
Hi,
I just briefly tried another theme. Now Activello is active again.
Sure, I still need the solution.
Thanks,
Aleksandar
jech
March 17, 2016, 4:07pm
4
Hi,
I think you could change this text in the function.php, but i can’t find how to paste it in the child folder (in a function file). If you don’t do that, your settings will be delete when upgrading your theme to a new version.
This is where i find how to change :
/*
* Function to modify search template for header
*/
function activello_header_search_filter($form){
$form = '<form action="'.esc_url( home_url( "/" ) ).'" method="get"><input type="text" name="s" value="'.get_search_query().'" placeholder="'. esc_attr_x( __('Search', 'activello'), 'search placeholder', 'activello' ).'"><button type="submit" class="header-search-icon" name="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button', 'activello' ).'"><i class="fa fa-search"></i></button></form>';
return $form;
}
If you find how to make this child file, let me know.
movin
March 18, 2016, 8:22am
5
Hi Aleksandar,
You can try achieving this by using the attached custom child theme of Activello theme that contains some custom code.
Best Regards,
Movin