Looking at a reply from 9 months ago over at https://wordpress.org/support/topic/customing-templates-when-theming-is-disabled/#post-14964278, this topic isn’t as simple as it ideally would be.
Also a person after my reply mentioned some issues regarding things like get_header() and get_footer(), so something to keep in mind.
Alternatively, I wonder if you’d be able to create an Oxygen Builder template in their setup, that holds the markup portions from the templates, and then load all of the javascript portions through the enqueue scripts system.
to create an Oxygen Builder template in their setup, that holds the markup portions from the templates, and then load all of the javascript portions through the enqueue scripts system.
Hi sorry for the late reply. I am not very techy.. wish I could understand what you mean. I think I should give it up.. have tried some other way but with no success. I just want to change the No results matched your query into another language. I edit the plugin template directly…any update I just go there and change the lines again.
I am trying to make the text a different language as the site is a multi-language site. I did something like this below doesn’t the condition does not work. Does not seem to be the question related to the plugin. Hope you don’t mind me asking… if we want to use a WP function like this one get_locale(). Usually, how should we do that? Thanks
<script type="text/html" id="tmpl-autocomplete-empty">
<div class="autocomplete-empty">
<?php
$current_language = get_locale();
if ($current_language = zh_HK){
echo esc_html_e( '沒有結果符合您的查詢 ', 'wp-search-with-algolia' );
}elseif ($current_language = en_HK){
echo esc_html_e( 'No results matched your query ', 'wp-search-with-algolia' );
}
?>
<span class="empty-query">"{{ data.query }}"</span>
</div>
</script>
At bare minimum, you’d want 2 equal signs, meaning == and not single = because that assigns the variable. Also won’t hurt to wrap the language codes in quotes to ensure it’s evaluated as a string.
if ($current_language == 'zh_HK'){
echo esc_html_e( '沒有結果符合您的查詢 ', 'wp-search-with-algolia' );
}elseif ($current_language == 'en_HK'){
echo esc_html_e( 'No results matched your query ', 'wp-search-with-algolia' );
}
Yes, it works!! Thank you for correcting the mistake!!