我有一个woocommerce网站,并希望搜索功能,以产品标签为基础的产品。我找到了一个插件,可以做到这一点,但我没有得到多少帮助,从开发人员。基本上,我有一个高级serach插件的短代码,我需要把它放在主题functions.php文件中。我是个新手,不知道该把它放在哪里/换掉。这将是一个短代码:
echo do_shortcode( '[aws_search_form id="YOUR_ID"]' );以下是主题的搜索表单代码:
<?php if ( (isset($shopkeeper_theme_options['main_header_search_bar'])) &&
($shopkeeper_theme_options['main_header_search_bar'] == "1") ) : ?>
<li class="search-button">
<a class="tools_button">
<span class="tools_button_icon">
<?php if (
(isset($shopkeeper_theme_options['main_header_search_bar_icon'])) &&
($shopkeeper_theme_options['main_header_search_bar_icon'] != "") ) : ?>
<img src="<?php echo
esc_url($shopkeeper_theme_options['main_header_search_bar_icon']); ?>">
<?php else : ?>
<i class="spk-icon-search"></i>
<?php endif; ?>
</span>
</a>
</li>
<?php endif; ?>谢谢
发布于 2017-11-20 16:31:23
您可以在主题中的任何文件中添加您的短代码,不仅在functions.php中,
所以您可以像这样修改您的search.php:
<?php if ( (isset($shopkeeper_theme_options['main_header_search_bar'])) &&
($shopkeeper_theme_options['main_header_search_bar'] == "1") ) : ?>
<?php echo do_shortcode( '[aws_search_form id="YOUR_ID"]' ); ?>
<?php endif; ?>https://stackoverflow.com/questions/47396407
复制相似问题