Beispiel #1
0
    /**
     * This method is used to display the output of the element.
     *
     * @return void
     */
    function element()
    {
        ?>

<div class="elm-searchbox elm-searchbox--<?php 
        echo $this->opt('sb_style', 'normal');
        ?>
 elm-searchbox--eff-<?php 
        echo $this->opt('sb_placeholder', 'normal');
        ?>
 <?php 
        echo $this->data['uid'];
        ?>
 <?php 
        echo $this->opt('css_class', '');
        ?>
">
	<div class="elm-searchbox__inner">
		<form class="elm-searchbox__form" action="<?php 
        echo home_url();
        ?>
" method="get">

			<input name="s" maxlength="30" class="elm-searchbox__input" type="text" size="20" value="" placeholder="<?php 
        echo $this->opt('sb_placeholder', 'normal') == 'normal' ? $this->opt('sb_placeholder_text', '') : '';
        ?>
" />
			<?php 
        if ($this->opt('sb_placeholder', 'normal') == 'typing') {
            ?>
			<span class="elm-searchbox__input-text"><?php 
            echo $this->opt('sb_placeholder_text', '');
            ?>
</span>
			<?php 
        }
        ?>

			<?php 
        if ($this->opt('sb_btn_type', 'icon') == 'icon') {
            ?>
				<button type="submit" class="elm-searchbox__submit glyphicon glyphicon-search"></button>
			<?php 
        } else {
            ?>
				<button type="submit" class="elm-searchbox__submit"><?php 
            echo $this->opt('sb_btn_text', '');
            ?>
</button>
			<?php 
        }
        ?>

			<?php 
        if ($this->opt('sb_search_type', 'wp') == 'wc' && znfw_is_woocommerce_active()) {
            ?>
				<input type="hidden" name="post_type" value="product">
			<?php 
        }
        ?>

			<div class="clearfix"></div>
		</form>
	</div>
</div>

<?php 
    }
    /**
     * Function to display the search box markup in header
     * @return html
     * @since  4.0.10
     */
    function zn_header_searchbox($sb_style = '')
    {
        if (zget_option('head_show_search', 'general_options', false, 'yes') == 'yes') {
            $search_style = !empty($sb_style) ? $sb_style : zget_option('head_search_style', 'general_options', false, 'def');
            ?>

        <div id="search" class="sh-component header-search headsearch--<?php 
            echo $search_style;
            ?>
">

            <a href="#" class="searchBtn header-search-button">
                <span class="glyphicon glyphicon-search kl-icon-white"></span>
            </a>

            <div class="search-container header-search-container">

                <form class="header-searchform" action="<?php 
            echo home_url();
            ?>
" method="get">
                    <input name="s" maxlength="20" class="inputbox header-searchform-text" type="text" size="20"
                        <?php 
            if ($search_style != 'bord') {
                ?>
                           value="<?php 
                echo __('SEARCH ...', 'zn_framework');
                ?>
"
                           onblur="if (this.value=='') this.value='<?php 
                echo __('SEARCH ...', 'zn_framework');
                ?>
';"
                           onfocus="if (this.value=='<?php 
                echo __('SEARCH ...', 'zn_framework');
                ?>
') this.value='';"
                        <?php 
            }
            ?>
                    />
                    <button type="submit" class="searchsubmit header-searchform-submit glyphicon glyphicon-search kl-icon-white"></button>

                    <?php 
            echo $search_style == 'inp' ? '<span class="kl-field-bg header-search-field-bg"></span>' : '';
            ?>

                    <?php 
            if (zget_option('woo_hd_search_type', 'zn_woocommerce_options', false, 'wp') == 'wc' && znfw_is_woocommerce_active()) {
                ?>
                        <input type="hidden" name="post_type" value="product">
                    <?php 
            }
            ?>

                </form>

            </div>
        </div>

        <?php 
        }
    }
 /**
  * Frontend: Load theme's plugins overrides stylesheets
  * @hooked to wp_enqueue_scripts.
  * @see functions.php
  */
 function wpkLoadPluginsCss()
 {
     // Woocommerce Own Stylesheet
     if (znfw_is_woocommerce_active()) {
         wp_enqueue_style('woocommerce-overrides', THEME_BASE_URI . '/css/plugins/kl-woocommerce.css', array('kallyas-styles'), ZN_FW_VERSION);
     }
     // BuddyPress Own Stylesheet
     if (zn_is_plugin_installed('buddypress')) {
         wp_enqueue_style('buddypress-overrides', THEME_BASE_URI . '/css/plugins/kl-buddypress.css', array('kallyas-styles'), ZN_FW_VERSION);
     }
     // BBpress Own Stylesheet
     if (zn_is_plugin_installed('bbpress')) {
         wp_enqueue_style('bbpress-overrides', THEME_BASE_URI . '/css/plugins/kl-bbpress.css', array('kallyas-styles'), ZN_FW_VERSION);
     }
 }
 /**
  * GETS current post id
  * SETS : $is_active_editor , $is_active_pagebuilder , $current_post_id
  *
  * @access private
  */
 public function get_post_id()
 {
     if (!empty(self::$post_id)) {
         return self::$post_id;
     }
     global $post;
     if (isset($_POST['post_id'])) {
         return self::$post_id = $_POST['post_id'];
     } elseif (is_singular() && !empty($post)) {
         return self::$post_id = $post->ID;
     } elseif (is_archive()) {
         // Check woocommerce archive
         if (znfw_is_woocommerce_active()) {
             // Woocommerce archive pages
             if (is_post_type_archive('product') || is_page(wc_get_page_id('shop'))) {
                 return wc_get_page_id('shop');
             }
         } else {
             return false;
         }
     } elseif (is_home()) {
         // This is the Blog archive page. We need to check if a custom page is used or not
         return get_option('page_for_posts');
     } else {
         return false;
     }
 }
Beispiel #5
0
<div class="search gensearch__wrapper kl-gensearch--<?php 
echo zget_option('zn_main_style', 'color_options', false, 'light');
?>
">
	<form id="searchform" class="gensearch__form" action="<?php 
echo home_url('/');
?>
" method="get">
		<input id="s" name="s" value="<?php 
echo get_search_query();
?>
" class="inputbox gensearch__input" type="text" placeholder="<?php 
esc_attr_e('SEARCH ...', 'zn_framework');
?>
" />
		<button type="submit" id="searchsubmit" value="go" class="gensearch__submit glyphicon glyphicon-search"></button>
		<?php 
if (zget_option('woo_site_search_type', 'zn_woocommerce_options', false, 'wp') == 'wc' && znfw_is_woocommerce_active()) {
    ?>
            <input type="hidden" name="post_type" value="product">
        <?php 
}
?>
	</form>
</div>