本文整理汇总了PHP中get_product_search_form函数的典型用法代码示例。如果您正苦于以下问题:PHP get_product_search_form函数的具体用法?PHP get_product_search_form怎么用?PHP get_product_search_form使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_product_search_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: oggi_header
function oggi_header()
{
?>
<img id="logo" src="http://oggi.pushbrand.com/wp-content/uploads/2015/08/oggi-logo.png" />
<?php
get_product_search_form();
}
示例2: search_shortcode
function search_shortcode()
{
ob_start();
get_product_search_form();
$content = ob_get_contents();
ob_end_clean();
return $content;
}
示例3: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
extract($args);
$title = $instance['title'];
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
get_product_search_form();
echo $after_widget;
}
示例4: search_shortcode
function search_shortcode($atts)
{
extract(shortcode_atts(array('size' => 'normal'), $atts));
if ($size == 'small') {
$size = 'style="font-size:80%"';
}
if ($size == 'large') {
$size = 'style="font-size:150%"';
}
if ($size == 'xlarge') {
$size = 'style="font-size:200%"';
}
ob_start();
echo '<div class="ux-search-box" ' . $size . '>';
get_product_search_form();
echo '</div>';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
示例5: thb_quick_search
function thb_quick_search()
{
$search_results = ot_get_option('search_results');
?>
<a href="#searchpopup" rel="inline" data-class="quick-search" id="quick_search"><i class="fa fa-search"></i></a>
<aside id="searchpopup" class="mfp-hide">
<div class="row">
<div class="small-12 columns">
<?php
if ($search_results == 'products') {
get_product_search_form();
} else {
get_search_form();
}
?>
</div>
</div>
</aside>
<?php
}
示例6: get_product_search_form
<?php
/**
* The Sidebar containing the main widget areas.
*
* @package Home Word
*/
?>
<aside class="sidebar-section store-sidebar">
<?php
get_product_search_form();
?>
<h3>Categories</h3>
<ul>
<?php
wp_list_categories(array('taxonomy' => 'product_cat', 'title_li' => ''));
?>
</ul>
<h3>Format</h3>
<?php
wp_nav_menu(array('theme_location' => 'format', 'menu_class' => 'cust-service', 'container' => false));
?>
<h3>Author</h3>
<ul>
<?php
wp_nav_menu(array('theme_location' => 'author', 'menu_class' => 'cust-service', 'container' => false));
?>
</ul>
<h3>Customer Service</h3>
<?php
wp_nav_menu(array('theme_location' => 'cust', 'menu_class' => 'cust-service', 'container' => false));
示例7: highwind_woocommerce_product_search
/**
* Displays the product search in the header if the options specify it
* @since 1.1.0
*/
function highwind_woocommerce_product_search()
{
$options = get_option('highwind_woocommerce_options');
$header_search = $options['header_search'];
if ($header_search && !is_checkout()) {
echo '<div class="highwind-product-search">';
get_product_search_form();
echo '</div>';
}
}
示例8: widget
/**
* widget function.
*
* @see WP_Widget
*
* @param array $args
* @param array $instance
*/
function widget($args, $instance)
{
$this->widget_start($args, $instance);
get_product_search_form();
$this->widget_end($args);
}
示例9: flatsome_mobile_menu
function flatsome_mobile_menu()
{
global $flatsome_opt, $woocommerce;
?>
<!-- Mobile Popup -->
<div id="jPanelMenu" class="mfp-hide">
<div class="mobile-sidebar">
<?php
if ($flatsome_opt['catalog_mode']) {
?>
<ul class="html-blocks">
<li class="html-block">
<?php
echo do_shortcode($flatsome_opt['catalog_mode_header']);
?>
</li>
</ul>
<?php
}
?>
<ul class="mobile-main-menu">
<?php
if ($flatsome_opt['search_pos'] !== 'hide') {
?>
<li class="search">
<?php
if (function_exists('get_product_search_form')) {
get_product_search_form();
} else {
get_search_form();
}
?>
</li><!-- .search-dropdown -->
<?php
}
?>
<?php
if (has_nav_menu('primary_mobile')) {
// Load custom mobile menu if set
wp_nav_menu(array('theme_location' => 'primary_mobile', 'container' => false, 'items_wrap' => '%3$s', 'depth' => 0));
} else {
// Load default menu
wp_nav_menu(array('theme_location' => 'primary', 'container' => false, 'items_wrap' => '%3$s', 'depth' => 0));
}
?>
<?php
if (ux_is_woocommerce_active() && $flatsome_opt['myaccount_dropdown']) {
?>
<li class="menu-item menu-account-item menu-item-has-children">
<?php
if (is_user_logged_in()) {
?>
<a href="<?php
echo get_permalink(get_option('woocommerce_myaccount_page_id'));
?>
">
<?php
_e('My Account', 'woocommerce');
?>
</a>
<ul class="sub-menu">
<?php
if (has_nav_menu('my_account')) {
?>
<?php
wp_nav_menu(array('theme_location' => 'my_account', 'container' => false, 'items_wrap' => '%3$s', 'depth' => 0));
?>
<?php
} else {
?>
<li>Define your My Account dropdown menu in <b>Appearance > Menus</b></li>
<?php
}
?>
</ul>
<?php
} else {
?>
<a href="<?php
echo get_permalink(get_option('woocommerce_myaccount_page_id'));
?>
"><?php
_e('Login', 'woocommerce');
?>
</a>
<?php
}
?>
</li>
<?php
//.........这里部分代码省略.........
示例10: kt_add_search_form_to_menu
function kt_add_search_form_to_menu($items, $args)
{
if (!($args->theme_location == 'primary_navigation')) {
return $items;
}
global $pinnacle, $woocommerce;
ob_start();
?>
<?php
if (class_exists('woocommerce')) {
?>
<?php
if (isset($pinnacle['menu_cart']) && $pinnacle['menu_cart'] == '1') {
?>
<li class="menu-cart-icon-kt panel"><a class="menu-cart-btn collapsed" data-toggle="collapse" data-parent="#kad-shrinkheader" data-target=".kad-head-cart-popup">
<span class="kt-cart-text"><?php
echo __('Your Cart', 'pinnacle');
?>
</span><i class="kt-icon-basket2"></i><span class="kt-cart-total"><?php
echo $woocommerce->cart->cart_contents_count;
?>
</span>
</a>
<div id="kad-head-cart-popup" class="collapse kad-head-cart-popup"><div class="kt-header-mini-cart-refreash"><?php
woocommerce_mini_cart();
?>
</div></div></li>
<?php
}
}
?>
<?php
if (isset($pinnacle['menu_search']) && $pinnacle['menu_search'] == '1') {
?>
<li class="menu-search-icon-kt panel"><a class="menu-search-btn collapsed" data-toggle="collapse" data-parent="#menu-main-menu" data-target="#kad-menu-search-popup"><i class="kt-icon-search4"></i></a>
<div id="kad-menu-search-popup" class="collapse">
<?php
if (isset($pinnacle['menu_search_products']) && $pinnacle['menu_search_products'] == '1') {
?>
<?php
get_product_search_form();
?>
<?php
} else {
?>
<?php
get_search_form();
?>
<?php
}
?>
</div>
</li>
<?php
}
?>
<?php
$output = ob_get_contents();
ob_end_clean();
return $items . $output;
}
示例11: search_shortcode
function search_shortcode()
{
return get_product_search_form();
}
示例12: cruxstore_add_search_full
function cruxstore_add_search_full()
{
if (cruxstore_option('header_search', 1)) {
$header_search_type = cruxstore_option('header_search_type', 'all');
if ($header_search_type == 'product' && cruxstore_is_wc()) {
$search = get_product_search_form(false);
} else {
$search = get_search_form(false);
}
printf('<div id="%1$s" class="%2$s">%3$s</div>', 'search-fullwidth', 'mfp-hide mfp-with-anim', $search);
}
}
示例13: cruxstore_show_slideshow
/**
* Show slideshow of page
*
* @param $post_id
*
*/
function cruxstore_show_slideshow($post_id = null)
{
global $post;
if (!$post_id) {
$post_id = $post->ID;
}
$slideshow = cruxstore_meta('_cruxstore_slideshow_type', array(), $post_id);
$sideshow_class = array();
$output = '';
if ($slideshow == 'revslider' || $slideshow == 'search') {
$revslider = cruxstore_meta('_cruxstore_rev_slider', array(), $post_id);
if ($revslider && class_exists('RevSlider')) {
ob_start();
putRevSlider($revslider);
$revslider_html = ob_get_contents();
ob_end_clean();
$output .= $revslider_html;
}
if ($slideshow == 'search') {
if (cruxstore_is_wc()) {
$search = get_product_search_form(false);
} else {
$search = get_search_form(false);
}
$output .= '<div class="searchform-wrap"><div class="container"><div class="searchform-inner">' . $search . '</div></div></div>';
}
} elseif ($slideshow == 'layerslider') {
$layerslider = cruxstore_meta('_cruxstore_layerslider', array(), $post_id);
if ($layerslider && is_plugin_active('LayerSlider/layerslider.php')) {
$layerslider_html = do_shortcode('[layerslider id="' . $layerslider . '"]');
if ($layerslider_html) {
$output .= $layerslider_html;
}
}
} elseif ($slideshow == 'custom') {
$customslider = cruxstore_meta('_cruxstore_slideshow_custom', array(), $post_id);
$output .= do_shortcode($customslider);
}
if ($output != '') {
printf('<div id="main-slideshow" class="%s"><div id="sideshow-inner">%s</div></div>', esc_attr(implode(' ', $sideshow_class)), $output);
}
}
示例14: kt_add_search_form_to_menu
function kt_add_search_form_to_menu($items, $args)
{
global $virtue_premium, $woocommerce;
if (!($args->theme_location == 'primary_navigation') || isset($virtue_premium['header_style']) && $virtue_premium['header_style'] == "center") {
return $items;
}
ob_start();
?>
<?php
if (class_exists('woocommerce')) {
?>
<?php
if (isset($virtue_premium['menu_cart']) && $virtue_premium['menu_cart'] == '1') {
?>
<li class="menu-cart-icon-kt sf-dropdown">
<a class="menu-cart-btn" title="<?php
echo __('Your Cart', 'virtue');
?>
" href="<?php
echo esc_url($woocommerce->cart->get_cart_url());
?>
">
<div class="kt-cart-container"><i class="icon-cart"></i><span class="kt-cart-total"><?php
echo $woocommerce->cart->get_cart_contents_count();
?>
</div></span>
</a>
<ul id="kad-head-cart-popup" class="sf-dropdown-menu kad-head-cart-popup">
<div class="kt-header-mini-cart-refreash">
<?php
woocommerce_mini_cart();
?>
</div>
</ul>
</li>
<?php
}
}
?>
<?php
if (isset($virtue_premium['menu_search']) && $virtue_premium['menu_search'] == '1') {
?>
<li class="menu-search-icon-kt">
<a class="kt-menu-search-btn collapsed" title="<?php
echo __('Search', 'virtue');
?>
" data-toggle="collapse" data-target="#kad-menu-search-popup">
<i class="icon-search"></i>
</a>
<div id="kad-menu-search-popup" class="search-container container collapse">
<div class="kt-search-container">
<?php
if (isset($virtue_premium['menu_search_woo']) && $virtue_premium['menu_search_woo'] == '1') {
get_product_search_form();
} else {
get_search_form();
}
?>
</div>
</div>
</li>
<?php
}
?>
<?php
$output = ob_get_contents();
ob_end_clean();
return $items . $output;
}
示例15: sprintf
$items_wrap .= sprintf('<li class="menu-item menu-item-currency"><a href="#">%s</a><ul class="sub-menu-dropdown">%s</ul></li>', esc_html__('Currency', 'cruxstore') . ': ' . $currency_active, $currency_html);
}
if (!cruxstore_option('catalog_mode', 0)) {
$text = is_user_logged_in() ? esc_html__('My Account', 'cruxstore') : esc_html__('Login', 'cruxstore');
$items_wrap .= sprintf('<li class="menu-item menu-item-myaccount"><a href="%s">call %s</a>', get_permalink(get_option('woocommerce_myaccount_page_id')), $text);
if (defined('YITH_WCWL')) {
global $yith_wcwl;
$wishlist = sprintf('<a href="%s">%s</a>', esc_url($yith_wcwl->get_wishlist_url()), esc_html__('wishlist', 'cruxstore'));
$items_wrap .= sprintf('<li class="menu-item menu-item-wishlist">%s</li>', $wishlist);
}
}
}
if (cruxstore_option('header_search', 1)) {
$header_search_type = cruxstore_option('header_search_type', 'all');
if ($header_search_type == 'product' && cruxstore_is_wc()) {
$search = get_product_search_form(false);
} else {
$search = get_search_form(false);
}
$items_wrap .= sprintf('<li class="menu-item menu-item-search-form">%s</li>', $search);
}
$primary = cruxstore_get_mainmenu();
if (!$primary['custom']) {
if (has_nav_menu($primary['menu'])) {
wp_nav_menu(array('theme_location' => $primary['menu'], 'container' => 'nav', 'container_class' => 'main-nav-mobile', 'container_id' => 'main-nav-mobile', 'menu_class' => 'menu navigation-mobile', 'link_before' => '<span>', 'link_after' => '</span>', 'walker' => new KTMegaWalker(), 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s' . $items_wrap . '</ul>'));
} else {
printf('<nav id="main-nav-mobile" class="main-nav-mobile"><ul class="menu navigation-mobile"><li><a href="%s">%s</a></li>%s</ul></nav>', admin_url('nav-menus.php'), esc_html__("Define your site main menu!", 'cruxstore'), $items_wrap);
}
} else {
wp_nav_menu(array('menu' => $primary['menu'], 'container' => 'nav', 'container_class' => 'main-nav-mobile', 'container_id' => 'main-nav-mobile', 'menu_class' => 'menu navigation-mobile', 'link_before' => '<span>', 'link_after' => '</span>', 'walker' => new KTMegaWalker(), 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s' . $items_wrap . '</ul>'));
}