Пример #1
0
        public function option_page()
        {
            ?>
		<div class="clear"></div>
		<div class="wrap">
			<input type="hidden" id="security" name="security" value="<?php 
            echo wp_create_nonce('dh_theme_option_ajax_security');
            ?>
" />
			<form method="post" action="options.php" enctype="multipart/form-data">
				<?php 
            settings_fields(self::$_option_name);
            ?>
				<div class="dh-opt-header">
					<div class="dh-opt-heading"><h2><?php 
            echo DH_THEME_NAME;
            ?>
 <span><?php 
            echo DH_THEME_VERSION;
            ?>
</span></h2> <a target="_blank" href="http://sitesao.com/<?php 
            echo basename(get_template_directory());
            ?>
/document"><?php 
            _e('Online Document', 'sitesao');
            ?>
</a></div>
				</div>
				<div class="clear"></div>
				<div class="dh-opt-actions">
					<em style="float: left; margin-top: 5px;"><?php 
            echo esc_html('Theme customizations are done here. Happy styling!', 'sitesao');
            ?>
</em>
					<button id="dh-opt-submit" name="dh_opt_save" class="button-primary" type="submit"><?php 
            echo __('Save All Change', 'sitesao');
            ?>
</button>
				</div>
				<div class="clear"></div>
				<div id="dh-opt-tab" class="dh-opt-wrap">
					<div class="dh-opt-sidebar">
						<ul id="dh-opt-menu" class="dh-opt-menu">
							<?php 
            $i = 0;
            ?>
							<?php 
            foreach ((array) $this->_sections as $key => $sections) {
                ?>
								<li<?php 
                echo $i == 0 ? ' class="current"' : '';
                ?>
>
									<a href="#<?php 
                echo esc_attr($key);
                ?>
" title="<?php 
                echo esc_attr($sections['title']);
                ?>
"><?php 
                echo isset($sections['icon']) ? '<i class="' . $sections['icon'] . '"></i> ' : '';
                echo esc_html($sections['title']);
                ?>
</a>
								</li>
							<?php 
                $i++;
                ?>
							<?php 
            }
            ?>
						</ul>
					</div>
					<div id="dh-opt-content" class="dh-opt-content">
						<?php 
            $i = 0;
            ?>
						<?php 
            foreach ((array) $this->_sections as $key => $sections) {
                ?>
							<div id=<?php 
                echo esc_attr($key);
                ?>
 class="dh-opt-section" <?php 
                echo $i == 0 ? ' style="display:block"' : '';
                ?>
>
								<h3><?php 
                echo esc_html($sections['title']);
                ?>
</h3>
								<?php 
                if (isset($sections['desc'])) {
                    ?>
								<div class="dh-opt-section-desc">
									<?php 
                    echo dh_print_string($sections['desc']);
                    ?>
								</div>
								<?php 
                }
                ?>
								<table class="form-table">
									<tbody>
										<?php 
                foreach ((array) $sections['fields'] as $field) {
                    ?>
										<tr>
											<?php 
                    if (!empty($field['label'])) {
                        ?>
											<th scope="row">
												<div class="dh-opt-label">
													<?php 
                        echo esc_html($field['label']);
                        ?>
													<?php 
                        if (!empty($field['desc'])) {
                            ?>
													<span class="description"><?php 
                            echo dh_print_string($field['desc']);
                            ?>
</span>
													<?php 
                        }
                        ?>
												</div>
											</th>
											<?php 
                    }
                    ?>
											<td <?php 
                    if (empty($field['label'])) {
                        ?>
colspan="2" <?php 
                    }
                    ?>
>
												<div class="dh-opt-field-wrap">
													<?php 
                    if (isset($field['callback'])) {
                        call_user_func($field['callback'], $field);
                    }
                    ?>
													<?php 
                    echo dh_print_string($this->_render_field($field));
                    ?>
												</div>
											</td>
										</tr>
										<?php 
                }
                ?>
									</tbody>
								</table>
							</div>
						<?php 
                $i++;
                ?>
						<?php 
            }
            ?>
					</div>
				</div>
				<div class="clear"></div>
				<div class="dh-opt-actions2">
					<button id="dh-opt-submit2" name="dh_opt_save" class="button-primary" type="submit"><?php 
            echo __('Save All Change', 'sitesao');
            ?>
</button>
					<button id="dh-opt-reset" name="<?php 
            echo self::$_option_name;
            ?>
[dh_opt_reset]" class="button" type="submit"><?php 
            echo __('Reset Options', 'sitesao');
            ?>
</button>
				</div>
				<div class="clear"></div>
			</form>
		</div>
		<?php 
        }
Пример #2
0
<?php

/**
 * Checkout login form
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.0.0
 */
if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
if (is_user_logged_in() || 'no' === get_option('woocommerce_enable_checkout_login_reminder')) {
    return;
}
$info_message = apply_filters('woocommerce_checkout_login_message', esc_html__('Returning customer?', 'jakiro'));
$info_message .= ' <a href="#" class="showlogin">' . esc_html__('Click here to login', 'jakiro') . '</a>';
?>
<div class="col-sm-7">
	<div class="woocommerce-info woocommerce-info-login"><?php 
echo dh_print_string($info_message);
?>
</div>
	<?php 
woocommerce_login_form(array('message' => esc_html__('If you have shopped with us before, please enter your details in the boxes below. If you are a new customer please proceed to the Billing &amp; Shipping section.', 'jakiro'), 'redirect' => wc_get_page_permalink('checkout'), 'hidden' => true));
?>
</div>
Пример #3
0
	</table>

	<input type="hidden" name="add-to-cart" value="<?php 
echo esc_attr($product->id);
?>
" />

	<?php 
if ($quantites_required) {
    ?>

		<?php 
    do_action('woocommerce_before_add_to_cart_button');
    ?>

		<button type="submit" class="single_add_to_cart_button button alt"><?php 
    echo dh_print_string($product->single_add_to_cart_text());
    ?>
</button>

		<?php 
    do_action('woocommerce_after_add_to_cart_button');
    ?>

	<?php 
}
?>
</form>

<?php 
do_action('woocommerce_after_add_to_cart_form');
Пример #4
0
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.1.0
 */
if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
?>

<?php 
do_action('woocommerce_before_add_to_cart_button');
?>

<div class="form_cart_actions">
<p class="cart">
	<a href="<?php 
echo esc_url($product_url);
?>
" rel="nofollow" class="single_add_to_cart_button button alt"><?php 
echo dh_print_string($button_text);
?>
</a>
	<?php 
DH_Woocommerce::instance()->yith_wishlist_do_shortcode();
?>
</p>
</div>

<?php 
do_action('woocommerce_after_add_to_cart_button');
Пример #5
0
    ?>
">
					<div class="row">
						<div class="footer-featured-col col-md-4 col-sm-6">
							<?php 
    echo dh_print_string(do_shortcode(dh_get_theme_option('footer-featured-1')));
    ?>
						</div>
						<div class="footer-featured-col col-md-4 col-sm-6">
							<?php 
    echo dh_print_string(do_shortcode(dh_get_theme_option('footer-featured-2')));
    ?>
						</div>
						<div class="footer-featured-col col-md-4 col-sm-6">
							<?php 
    echo dh_print_string(do_shortcode(dh_get_theme_option('footer-featured-3')));
    ?>
						</div>
					</div>
				</div>
			</div>
		<?php 
}
?>

		<?php 
if (dh_get_theme_option('footer-area', 1)) {
    ?>
			<div class="footer-widget">
				<div class="<?php 
    dh_container_class();
Пример #6
0
        $cat = $cat[0];
        echo get_category_parents($cat, true, '' . $delimiter);
        echo dh_print_string($before) . '<span typeof="v:Breadcrumb"><a href="' . get_permalink($parent) . '" property="v:title" rel="v:url"><span>' . $parent->post_title . '</span></a></span>' . dh_print_string($after) . $delimiter;
        echo dh_print_string($before) . get_the_title() . dh_print_string($after);
    } elseif (is_page() && !$post->post_parent) {
        echo dh_print_string($before) . '<span typeof="v:Breadcrumb" property="v:title">' . get_the_title() . '</span>' . dh_print_string($after);
    } elseif (is_page() && $post->post_parent) {
        $parent_id = $post->post_parent;
        $breadcrumbs = array();
        while ($parent_id) {
            $page = get_page($parent_id);
            $breadcrumbs[] = '<span typeof="v:Breadcrumb"><a href="' . get_permalink($page->ID) . '" property="v:title" rel="v:url"><span>' . get_the_title($page->ID) . '</span></a></span>';
            $parent_id = $page->post_parent;
        }
        $breadcrumbs = array_reverse($breadcrumbs);
        foreach ($breadcrumbs as $crumb) {
            echo dh_print_string($crumb) . '' . $delimiter;
        }
        echo dh_print_string($before) . '<span typeof="v:Breadcrumb" property="v:title">' . get_the_title() . '</span>' . dh_print_string($after);
    } elseif (is_search()) {
        echo dh_print_string($before) . '<span typeof="v:Breadcrumb" property="v:title">' . esc_html__('Search results for &ldquo;', 'woow') . get_search_query() . '&rdquo;' . '</span>' . dh_print_string($after);
    } elseif (is_tag()) {
        echo dh_print_string($before) . '<span typeof="v:Breadcrumb" property="v:title">' . esc_html__('Posts tagged &ldquo;', 'woow') . single_tag_title('', false) . '&rdquo;' . '</span>' . dh_print_string($after);
    } elseif (is_author()) {
        $userdata = get_userdata($author);
        echo dh_print_string($before) . '<span typeof="v:Breadcrumb" property="v:title">' . esc_html__('Author:', 'woow') . ' ' . $userdata->display_name . '</span>' . dh_print_string($after);
    }
    // 	if ( get_query_var( 'paged' ) )
    // 		echo '<span typeof="v:Breadcrumb" property="v:title">'. ' (' . esc_html__( 'Page', 'woow' ) . ' ' . get_query_var( 'paged' ) . ')'.'</span>';
    echo dh_print_string($wrap_after);
}
Пример #7
0
function dh_mailchimp_form($echo = true)
{
    ob_start();
    ?>
	<form id="mailchimp-form-<?php 
    echo wp_create_nonce('mailchimp_subscribe_nonce');
    ?>
" method="get" class="mailchimp-form" action="<?php 
    echo home_url('/');
    ?>
">
		<?php 
    $mailchimp_subscribe = isset($_GET['mailchimp_subscribe']) ? $_GET['mailchimp_subscribe'] : '';
    if (!empty($mailchimp_subscribe)) {
        ?>
		<div class="mailchimp-form-result">
			<?php 
        if ($mailchimp_subscribe == -1) {
            echo '<span class="error">' . esc_html__('Not Subscribe to Mailchimp!', 'sitesao') . '<span>';
        } elseif ($mailchimp_subscribe == 1) {
            echo '<span class="success">' . esc_html__('Subscribe to Mailchimp Successful!', 'sitesao') . '</span>';
        }
        ?>
		</div>
		<?php 
    }
    ?>
		<div class="mailchimp-form-content clearfix">
			<div class="row">
				<div class="col-sm-8">
					<label for="" class="hide"><?php 
    esc_html_e('Subscribe', 'sitesao');
    ?>
</label>
					<input type="email" class="form-control"  required="required" autocomplete="off" placeholder="<?php 
    _e('Enter your email...', 'sitesao');
    ?>
" name="email">
				</div>
				<div class="col-sm-4">
					<button type="submit" class="btn btn-outline mailchimp-submit"><?php 
    esc_html_e('Subscribe', 'sitesao');
    ?>
</button>
				</div>
			</div>
			<div style="display: none;">
				<input type="hidden" name="_subscribe_nonce" value="<?php 
    echo wp_create_nonce('mailchimp_subscribe_nonce');
    ?>
">
				<input type="hidden" name="action" value="dh_mailchimp_subscribe">
			</div>
		</div>
	</form>
	<?php 
    $form = ob_get_clean();
    $form = apply_filters('mailchimp_form', $form);
    if ($echo) {
        echo dh_print_string($form);
    } else {
        return $form;
    }
}
Пример #8
0
        public function shortcode_output($atts, $content = null)
        {
            /**
             * script
             * {{
             */
            wp_enqueue_script('vendor-parallax');
            wp_enqueue_script('vendor-imagesloaded');
            extract(shortcode_atts(array('slider_slug' => '', 'visibility' => '', 'el_class' => ''), $atts));
            if (empty($slider_slug)) {
                return '';
            }
            $el_class = !empty($el_class) ? ' ' . esc_attr($el_class) : '';
            switch ($visibility) {
                case 'hidden-phone':
                    $el_class .= ' hidden-xs';
                    break;
                case 'hidden-tablet':
                    $el_class .= ' hidden-sm hidden-md';
                    break;
                case 'hidden-pc':
                    $el_class .= ' hidden-lg';
                    break;
                case 'visible-phone':
                    $el_class .= ' visible-xs-inline';
                    break;
                case 'visible-tablet':
                    $el_class .= ' visible-sm-inline visible-md-inline';
                    break;
                case 'visible-pc':
                    $el_class .= ' visible-lg-inline';
                    break;
            }
            $args = array('orderby' => "menu_order", 'order' => "ASC", 'posts_per_page' => -1, 'post_status' => 'publish', 'post_type' => 'dh_slide');
            $args['tax_query'][] = array('taxonomy' => 'dh_slider', 'terms' => $slider_slug, 'field' => 'slug', 'operator' => 'IN');
            $slides = new WP_Query($args);
            ob_start();
            if ($slides->have_posts()) {
                $setting_options = get_option('dh_slider_settings');
                $slider = get_term_by('slug', $slider_slug, 'dh_slider');
                if (!$slider || is_wp_error($slider)) {
                    return '';
                }
                $settings = isset($setting_options[$slider->term_id]) ? $setting_options[$slider->term_id] : array();
                $layout = isset($settings['layout']) ? $settings['layout'] : 'fullscreen';
                $width = isset($settings['width']) ? $settings['width'] : '100%';
                $height = isset($settings['height']) ? $settings['height'] : '650';
                $auto_run = isset($settings['auto_run']) ? $settings['auto_run'] : 'yes';
                $duration = isset($settings['duration']) ? $settings['duration'] : '6000';
                $width = $width == '100%' ? $width : $width . 'px';
                if ($layout == 'fullscreen') {
                    $width = '100%';
                }
                $height = $height . 'px';
                $indicators = '';
                $id = uniqid('dhslider_');
                ?>
		<div id="<?php 
                echo esc_attr($id);
                ?>
" data-autorun="<?php 
                echo esc_attr($auto_run);
                ?>
" data-duration="<?php 
                echo esc_attr($duration);
                ?>
" class="carousel slide fade dhslider dhslider-<?php 
                echo esc_attr($layout);
                ?>
 <?php 
                echo esc_attr($el_class);
                ?>
" data-height="<?php 
                echo isset($settings['height']) ? $settings['height'] : '650';
                ?>
" style="width: <?php 
                echo esc_attr($width);
                ?>
;height: <?php 
                echo esc_attr($height);
                ?>
">
			<div class="dhslider-loader"><div class="fade-loading"><i></i><i></i><i></i><i></i></div></div>
			<div class="carousel-inner dhslider-wrap">
				<?php 
                $i = 0;
                ?>
				<?php 
                while ($slides->have_posts()) {
                    $slides->the_post();
                    global $post;
                    ?>
				<?php 
                    $indicators .= '<li data-target="#' . $id . '" data-slide-to="' . $i . '"';
                    if ($i == 0) {
                        $indicators .= ' class="active"';
                    }
                    $indicators .= '></li>';
                    $bg_type = dh_get_post_meta('bg_type');
                    $link_type = dh_get_post_meta('link_type');
                    ?>
				<div class="item slider-item <?php 
                    echo $i == 0 ? ' active' : '';
                    ?>
" style="height: <?php 
                    echo esc_attr($height);
                    ?>
">
					<?php 
                    if ($bg_type == 'image') {
                        ?>
					<?php 
                        $bg_image = dh_get_post_meta('bg_image');
                        if (!empty($bg_image)) {
                            echo '<div class="slide-bg" style="background-image:url(' . wp_get_attachment_url($bg_image) . ')">';
                            echo '</div>';
                        }
                        ?>
					<?php 
                    } elseif ($bg_type == 'video') {
                        $bg_video_poster = dh_get_post_meta('bg_video_poster');
                        $bg_video = '';
                        $bg_video_args = array();
                        echo '<div class="slide-bg" style="background-image:url(' . wp_get_attachment_url($bg_video_poster) . ')">';
                        if ($bg_video_src_mp4 = dh_get_post_meta('bg_video_mp4')) {
                            $bg_video_args['mp4'] = $bg_video_src_mp4;
                        }
                        if ($bg_video_src_ogv = dh_get_post_meta('bg_video_ogv')) {
                            $bg_video_args['ogv'] = $bg_video_src_ogv;
                        }
                        if ($bg_video_src_webm = dh_get_post_meta('bg_video_webm')) {
                            $bg_video_args['webm'] = $bg_video_src_webm;
                        }
                        if (!empty($bg_video_args)) {
                            $attr_strings = array('loop="1"', 'preload="1"', 'autoplay="autoplay"', 'muted="muted"');
                            if (!empty($bg_video_poster)) {
                                $bg_image_path = wp_get_attachment_image_src($bg_video_poster, 'dh-full');
                                if (!empty($bg_image_path)) {
                                    $attr_strings[] = 'poster="' . esc_url($bg_image_path[0]) . '"';
                                }
                            }
                            $bg_video .= sprintf('<div class="video-embed-wrap"><video %s width="1800" height="700" class="slider-video">', join(' ', $attr_strings));
                            $source = '<source type="%s" src="%s" />';
                            foreach ($bg_video_args as $video_type => $video_src) {
                                $video_type = wp_check_filetype($video_src, wp_get_mime_types());
                                $bg_video .= sprintf($source, $video_type['type'], esc_url($video_src));
                            }
                            $bg_video .= '</video></div>';
                        }
                        ?>
						<?php 
                        echo $bg_video;
                        ?>
						<?php 
                        echo '</div>';
                        ?>
					<?php 
                    }
                    ?>
					<!-- <div class="slider-overlay"></div> -->
					<?php 
                    if ($link_type == 'link') {
                        ?>
					<a class="slide-link" target="_blank" href="<?php 
                        echo esc_url(dh_get_post_meta('slide_url'));
                        ?>
"></a>
					<?php 
                    }
                    ?>
					<div class="slider-caption caption-align-<?php 
                    echo dh_get_post_meta('caption_align', get_the_ID(), 'center');
                    ?>
">
						<div class="slider-caption-wrap">
							<?php 
                    $top_heading = dh_get_post_meta('top-heading');
                    $caption = dh_get_post_meta('caption');
                    $heading = dh_get_post_meta('heading');
                    $top_heading_color = dh_get_post_meta('top_heading_color');
                    $heading_color = dh_get_post_meta('heading_color');
                    $caption_color = dh_get_post_meta('caption_color');
                    ?>
							<?php 
                    if (!empty($top_heading)) {
                        ?>
							<span class="slider-top-caption-text"<?php 
                        if (!empty($top_heading_color)) {
                            ?>
 style="color:<?php 
                            echo esc_attr($top_heading_color);
                            ?>
"<?php 
                        }
                        ?>
><?php 
                        echo esc_html($top_heading);
                        ?>
</span>
							<?php 
                    }
                    ?>
							<?php 
                    if (!empty($heading)) {
                        ?>
							<h2 class="slider-heading-text"<?php 
                        if (!empty($heading_color)) {
                            ?>
 style="color:<?php 
                            echo esc_attr($heading_color);
                            ?>
"<?php 
                        }
                        ?>
><?php 
                        echo esc_html($heading);
                        ?>
</h2>
							<?php 
                    }
                    ?>
							<?php 
                    if (!empty($caption)) {
                        ?>
							<div class="slider-caption-text"<?php 
                        if (!empty($caption_color)) {
                            ?>
 style="color:<?php 
                            echo esc_attr($caption_color);
                            ?>
"<?php 
                        }
                        ?>
><?php 
                        echo dh_print_string($caption);
                        ?>
</div>
							<?php 
                    }
                    ?>
							<?php 
                    if ($link_type == 'button') {
                        ?>
								<?php 
                        $button_primary_text = dh_get_post_meta('button_primary_text');
                        $button_primary_link = dh_get_post_meta('button_primary_link');
                        $button_primary_style = dh_get_post_meta('button_primary_style');
                        $button_primary_color = dh_get_post_meta('button_primary_color');
                        if ($button_primary_style == 'outlined') {
                            $button_primary_color .= '-outline';
                        }
                        $button_secondary_text = dh_get_post_meta('button_secondary_text');
                        $button_secondary_link = dh_get_post_meta('button_secondary_link');
                        $button_secondary_style = dh_get_post_meta('button_secondary_style');
                        $button_secondary_color = dh_get_post_meta('button_secondary_color');
                        if ($button_secondary_style == 'outlined') {
                            $button_secondary_color .= '-outline';
                        }
                        ?>
								<div class="slider-buttons">
									<?php 
                        if (!empty($button_primary_text)) {
                            ?>
									<a href="<?php 
                            echo esc_url($button_primary_link);
                            ?>
" class="btn btn-lg btn-<?php 
                            echo esc_attr($button_primary_color);
                            ?>
"><?php 
                            echo esc_html($button_primary_text);
                            ?>
</a>
									<?php 
                        }
                        ?>
									<?php 
                        if (!empty($button_secondary_text)) {
                            ?>
									<a href="<?php 
                            echo esc_url($button_secondary_link);
                            ?>
" class="btn btn-lg btn-<?php 
                            echo esc_attr($button_secondary_color);
                            ?>
"><?php 
                            echo esc_html($button_secondary_text);
                            ?>
</a>
									<?php 
                        }
                        ?>
								</div>
							<?php 
                    }
                    ?>
						</div>
					</div>
				</div>
				<?php 
                    $i++;
                    ?>
				<?php 
                }
                ?>
			</div>
			<?php 
                if ($slides->post_count > 1) {
                    ?>
			<ol class="carousel-indicators parallax-content">
				<?php 
                    echo $indicators;
                    ?>
			</ol>
			<?php 
                }
                ?>
			<a class="left carousel-control parallax-content" href="<?php 
                echo '#' . $id;
                ?>
" role="button" data-slide="prev">
				<i class="fa fa-angle-left carousel-icon-prev"></i>
			</a>
			<a class="right carousel-control parallax-content" href="<?php 
                echo '#' . $id;
                ?>
" role="button" data-slide="next">
				<i class="fa fa-angle-right carousel-icon-next"></i>
			</a>
		</div>
		<?php 
            }
            $output = ob_get_clean();
            wp_reset_postdata();
            return $output;
        }
Пример #9
0
            echo esc_attr($gateway->id);
            ?>
" type="radio" class="input-radio" name="payment_method" value="<?php 
            echo esc_attr($gateway->id);
            ?>
" <?php 
            checked($gateway->chosen, true);
            ?>
 data-order_button_text="<?php 
            echo esc_attr($gateway->order_button_text);
            ?>
" /><i></i> <?php 
            echo dh_print_string($gateway->get_title());
            ?>
 <?php 
            echo dh_print_string($gateway->get_icon());
            ?>
</label>
							<?php 
            if ($gateway->has_fields() || $gateway->get_description()) {
                echo '<div class="payment_box payment_method_' . $gateway->id . '" style="display:none;">';
                $gateway->payment_fields();
                echo '</div>';
            }
            ?>
						</li>
						<?php 
        }
    } else {
        echo '<p>' . esc_html__('Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woow') . '</p>';
    }
Пример #10
0
							<?php 
            $image = wp_get_attachment_image($attachment_id, apply_filters('single_product_large_thumbnail_size', 'shop_single'));
            $image_title = esc_attr(get_the_title($attachment_id));
            $image_full = wp_get_attachment_image_src($attachment_id, 'full');
            ?>
							<li class="caroufredsel-item">
								<div class="thumb">
									<a href="<?php 
            echo esc_attr(@$image_full[0]);
            ?>
" data-rel="magnific-popup-verticalfit" title="<?php 
            echo esc_attr($image_title);
            ?>
">
										<?php 
            echo dh_print_string($image);
            ?>
									</a>
								</div>
							</li>
							<?php 
            $loop++;
        }
        ?>
						<?php 
    }
    ?>
					</ul>
					<a href="#" class="caroufredsel-prev"></a>
					<a href="#" class="caroufredsel-next"></a>
				</div>
Пример #11
0
function dh_render_meta_boxes($post, $meta_box)
{
    $args = $meta_box['args'];
    if (!defined('DH_META_BOX_NONCE')) {
        define('DH_META_BOX_NONCE', 1);
        wp_nonce_field('dh_meta_box_nonce', 'dh_meta_box_nonce', false);
    }
    if (!is_array($args)) {
        return false;
    }
    echo '<div class="dh-metaboxes">';
    if (isset($args['description']) && $args['description'] != '') {
        echo '<p>' . $args['description'] . '</p>';
    }
    $count = 0;
    foreach ($args['fields'] as $field) {
        if (!isset($field['type'])) {
            continue;
        }
        $field['name'] = isset($field['name']) ? $field['name'] : '';
        $field['name'] = strstr($field['name'], '_dh_') ? sanitize_title($field['name']) : '_dh_' . sanitize_title($field['name']);
        $value = get_post_meta($post->ID, $field['name'], true);
        $field['value'] = isset($field['value']) ? $field['value'] : '';
        if ($value !== '' && $value !== null && $value !== array() && $value !== false) {
            $field['value'] = $value;
        }
        $field['id'] = isset($field['id']) ? $field['id'] : $field['name'];
        $field['description'] = isset($field['description']) ? $field['description'] : '';
        $field['label'] = isset($field['label']) ? $field['label'] : '';
        $field['placeholder'] = isset($field['placeholder']) ? $field['placeholder'] : $field['label'];
        $field['fname'] = $field['name'];
        $field['name'] = 'dh_meta[' . $field['name'] . ']';
        if (isset($field['callback']) && !empty($field['callback'])) {
            call_user_func($field['callback'], $post, $field);
        } else {
            switch ($field['type']) {
                case 'heading':
                    echo '<h4>' . $field['heading'] . '</h4>';
                    break;
                    break;
                case 'hr':
                    echo '<div style="margin-top:20px;margin-bottom:20px;">';
                    echo '<hr>';
                    echo '</div>';
                    break;
                case 'text':
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field"><label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label><input type="text" name="' . esc_attr($field['name']) . '" id="' . esc_attr($field['id']) . '" value="' . esc_attr($field['value']) . '" placeholder="' . esc_attr($field['placeholder']) . '" style="width: 99%;" /> ';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    if (isset($field['hidden']) && $field['hidden'] == true) {
                        $hidden_name = 'dh_meta[' . $field['fname'] . '_hidden]';
                        $value = get_post_meta($post->ID, $field['fname'], true);
                        $hidden_value = isset($field['hidden_value']) ? $field['hidden_value'] : '';
                        if ($value !== '' && $value !== null && $value !== array() && $value !== false) {
                            $hidden_value = $value;
                        }
                        echo '<input type="hidden" name="' . esc_attr($hidden_name) . '" value="' . esc_attr($hidden_value) . '">';
                    }
                    echo '</div>';
                    break;
                case 'color':
                    wp_enqueue_style('wp-color-picker');
                    wp_enqueue_script('wp-color-picker');
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field"><label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label><input type="text" name="' . esc_attr($field['name']) . '" id="' . esc_attr($field['id']) . '" value="' . esc_attr($field['value']) . '" placeholder="' . esc_attr($field['placeholder']) . '" /> ';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '<script type="text/javascript">
						jQuery(document).ready(function($){
						    $("#' . esc_attr($field['id']) . '").wpColorPicker();
						});
					 </script>
					';
                    echo '</div>';
                    break;
                case 'textarea':
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field"><label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label><textarea name="' . esc_attr($field['name']) . '" id="' . esc_attr($field['id']) . '" placeholder="' . esc_attr($field['placeholder']) . '" rows="5" cols="20" style="width: 99%;">' . esc_textarea($field['value']) . '</textarea> ';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '</div>';
                    break;
                case 'checkbox':
                    $field['cbvalue'] = isset($field['cbvalue']) ? $field['cbvalue'] : '1';
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field"><label for="' . esc_attr($field['id']) . '"><strong>' . esc_html($field['label']) . '</strong></label><input type="checkbox" name="' . esc_attr($field['name']) . '" id="' . esc_attr($field['id']) . '" value="0"  checked="checked" style="display:none" /><input class="checkbox" type="checkbox" name="' . esc_attr($field['name']) . '" id="' . esc_attr($field['id']) . '" value="' . esc_attr($field['cbvalue']) . '" ' . checked($field['value'], $field['cbvalue'], false) . ' /> ';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '</div>';
                    break;
                case 'categories':
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field"><label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label>';
                    wp_dropdown_categories(array('name' => esc_attr($field['name']), 'id' => esc_attr($field['id']), 'hierarchical' => 1, 'selected' => $field['value']));
                    echo '</div>';
                    break;
                case 'widgetised_sidebars':
                    $sidebars = $GLOBALS['wp_registered_sidebars'];
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field"><label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label><select id="' . esc_attr($field['id']) . '" name="' . esc_attr($field['name']) . '">';
                    echo '<option value="">' . __('Select a sidebar...', 'sitesao') . '</option>';
                    foreach ($sidebars as $sidebar) {
                        $selected = '';
                        if ($sidebar["id"] == $field['value']) {
                            $selected = ' selected="selected"';
                        }
                        $sidebar_name = $sidebar["name"];
                        echo '<option value="' . $sidebar["id"] . '"' . $selected . '>' . $sidebar_name . '</option>';
                    }
                    echo '</select> ';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '</div>';
                    break;
                    break;
                case 'select':
                    $field['options'] = isset($field['options']) ? $field['options'] : array();
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field"><label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label><select id="' . esc_attr($field['id']) . '" name="' . esc_attr($field['name']) . '">';
                    foreach ($field['options'] as $key => $value) {
                        echo '<option value="' . esc_attr($key) . '" ' . selected(esc_attr($field['value']), esc_attr($key), false) . '>' . esc_html($value) . '</option>';
                    }
                    echo '</select> ';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '</div>';
                    break;
                case 'radio':
                    $field['options'] = isset($field['options']) ? $field['options'] : array();
                    echo '<fieldset ' . $data_dependency . ' class="form-field ' . esc_attr($field['id']) . '_field"><legend>' . esc_html($field['label']) . '</legend><ul>';
                    foreach ($field['options'] as $key => $value) {
                        echo '<li><label><input
					        		name="' . esc_attr($field['name']) . '"
					        		value="' . esc_attr($key) . '"
					        		type="radio"
									class="radio"
					        		' . checked(esc_attr($field['value']), esc_attr($key), false) . '
					        		/> ' . esc_html($value) . '</label>
					    	</li>';
                    }
                    echo '</ul>';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '</fieldset>';
                    break;
                case 'gallery':
                    if (function_exists('wp_enqueue_media')) {
                        wp_enqueue_media();
                    } else {
                        wp_enqueue_style('thickbox');
                        wp_enqueue_script('media-upload');
                        wp_enqueue_script('thickbox');
                    }
                    if (!defined('_DH_META_GALLERY_JS')) {
                        define('_DH_META_GALLERY_JS', 1);
                        ?>
					<script type="text/javascript">
						jQuery(document).ready(function($) {
							$('.dh-meta-gallery-select').on('click',function(e){
								e.stopPropagation();
								e.preventDefault();
								
								var $this = $(this),
									dh_meta_gallery_list = $this.closest('.dh-meta-box-field').find('.dh-meta-gallery-list'),
									dh_meta_gallery_frame,
									dh_meta_gallery_ids = $this.closest('.dh-meta-box-field').find('#dh_meta_gallery_ids'),
									_ids = dh_meta_gallery_ids.val();
	
								if(dh_meta_gallery_frame){
									dh_meta_gallery_frame.open();
									return false;
								}
								
								dh_meta_gallery_frame = wp.media({
									title: '<?php 
                        echo __('Add Images to Gallery', 'sitesao');
                        ?>
',
									button: {
										text: '<?php 
                        echo __('Add to Gallery', 'sitesao');
                        ?>
',
									},
									library: { type: 'image' },
									multiple: true
								});
	
								dh_meta_gallery_frame.on('select',function(){
									var selection = dh_meta_gallery_frame.state().get('selection');
									selection.map( function( attachment ) {
										attachment = attachment.toJSON();
										if ( attachment.id ) {
											_ids = _ids ? _ids + "," + attachment.id : attachment.id;
											dh_meta_gallery_list.append('\
												<li data-id="' + attachment.id +'">\
													<div class="thumbnail">\
														<div class="centered">\
															<img src="' + attachment.url + '" />\
														</div>\
														<a href="#" title="<?php 
                        echo __('Delete', 'sitesao');
                        ?>
"><?php 
                        echo __('x', 'sitesao');
                        ?>
</a></li>\
													</div>\
												</li>'
											);
										}
										dh_meta_gallery_ids.val( dh_trim(_ids,',') );
										dh_meta_gallery_fn();
									});
								});
	
								dh_meta_gallery_frame.open();
							});
							var dh_meta_gallery_fn = function(){
								if($('.dh-meta-gallery-list').length){
									$('.dh-meta-gallery-list').each(function(){
										var $this = $(this);
										$this.sortable({
											items: 'li',
											cursor: 'move',
											forcePlaceholderSize: true,
											forceHelperSize: false,
											helper: 'clone',
											opacity: 0.65,
											placeholder: 'li-placeholder',
											start:function(event,ui){
												ui.item.css('background-color','#f6f6f6');
											},
											update: function(event, ui) {
												var _ids = '';
												$this.find('li').each(function() {
													var _id = $(this).data( 'id' );
													_ids = _ids + _id + ',';
												});
									
												$this.closest('.dh-meta-box-field').find('#dh_meta_gallery_ids').val( dh_trim(_ids,',') );
											}
										});
	
										$this.find('a').on( 'click',function(e) {
											e.stopPropagation();
											e.preventDefault();
											$(this).closest('li').remove();
											var _ids = '';
											$this.find('li').each(function() {
												var _id = $(this).data( 'id' );
												_ids = _ids + _id + ',';
											});
	
											$this.closest('.dh-meta-box-field').find('#dh_meta_gallery_ids').val( dh_trim(_ids,',') );
	
											return false;
										});
										
									});
								}
							}
							dh_meta_gallery_fn();
						});
					</script>
					<?php 
                    }
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field">';
                    echo '<label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label>';
                    echo '<div class="dh-meta-gallery-wrap"><ul class="dh-meta-gallery-list">';
                    if ($field['value']) {
                        $value_arr = explode(',', $field['value']);
                        if (!empty($value_arr) && is_array($value_arr)) {
                            foreach ($value_arr as $attachment_id) {
                                if ($attachment_id) {
                                    ?>
								<li data-id="<?php 
                                    echo esc_attr($attachment_id);
                                    ?>
">
									<div class="thumbnail">
										<div class="centered">
											<?php 
                                    echo wp_get_attachment_image($attachment_id, array(120, 120));
                                    ?>
						
										</div>
										<a title="<?php 
                                    echo __('Delete', 'sitesao');
                                    ?>
" href="#"><?php 
                                    echo __('x', 'sitesao');
                                    ?>
</a>
									</div>						
								</li>
							<?php 
                                }
                            }
                        }
                    }
                    echo '</ul></div>';
                    echo '<input type="hidden" name="' . $field['name'] . '" id="dh_meta_gallery_ids" value="' . $field['value'] . '" />';
                    echo '<input type="button" class="button button-primary dh-meta-gallery-select" name="' . $field['id'] . '_button_upload" id="' . $field['id'] . '_upload" value="' . __('Add Gallery Images', 'sitesao') . '" /> ';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '</div>';
                    break;
                case 'media':
                    if (function_exists('wp_enqueue_media')) {
                        wp_enqueue_media();
                    } else {
                        wp_enqueue_style('thickbox');
                        wp_enqueue_script('media-upload');
                        wp_enqueue_script('thickbox');
                    }
                    $btn_text = !empty($field['value']) ? __('Change Media', 'sitesao') : __('Select Media', 'sitesao');
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field">';
                    echo '<label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label>';
                    echo '<input type="text" name="' . esc_attr($field['name']) . '" id="' . esc_attr($field['id']) . '" value="' . esc_attr($field['value']) . '" placeholder="' . esc_attr($field['placeholder']) . '" style="width: 99%;margin-bottom:5px" />';
                    echo '<input type="button" class="button button-primary" name="' . $field['id'] . '_button_upload" id="' . $field['id'] . '_upload" value="' . $btn_text . '" /> ';
                    echo '<input type="button" class="button" name="' . $field['id'] . '_button_clear" id="' . $field['id'] . '_clear" value="' . __('Clear', 'sitesao') . '" />';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    echo '</div>';
                    ?>
					<script type="text/javascript">
						jQuery(document).ready(function($) {
							<?php 
                    if (empty($field['value'])) {
                        ?>
 $('#<?php 
                        echo esc_attr($field['id']);
                        ?>
_clear').css('display', 'none'); <?php 
                    }
                    ?>
							$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_upload').on('click', function(event) {
								event.preventDefault();
								var $this = $(this);
		
								// if media frame exists, reopen
								if(dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_media_frame) {
									dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_media_frame.open();
					                return;
					            }
		
								// create new media frame
								// I decided to create new frame every time to control the selected images
								var dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_media_frame = wp.media.frames.wp_media_frame = wp.media({
									title: "<?php 
                    echo __('Select or Upload your Media', 'sitesao');
                    ?>
",
									button: {
										text: "<?php 
                    echo __('Select', 'sitesao');
                    ?>
"
									},
									library: { type: 'video,audio' },
									multiple: false
								});
		
								// when image selected, run callback
								dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_media_frame.on('select', function(){
									var attachment = dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_media_frame.state().get('selection').first().toJSON();
									$this.closest('.dh-meta-box-field').find('input#<?php 
                    echo esc_attr($field['id']);
                    ?>
').val(attachment.url);
									
									$this.attr('value', '<?php 
                    echo __('Change Media', 'sitesao');
                    ?>
');
									$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_clear').css('display', 'inline-block');
								});
		
								// open media frame
								dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_media_frame.open();
							});
		
							$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_clear').on('click', function(event) {
								var $this = $(this);
								$this.hide();
								$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_upload').attr('value', '<?php 
                    echo __('Select Media', 'sitesao');
                    ?>
');
								$this.closest('.dh-meta-box-field').find('#<?php 
                    echo esc_attr($field['id']);
                    ?>
').val('');
							});
						});
					</script>
					<?php 
                    break;
                case 'image':
                    if (function_exists('wp_enqueue_media')) {
                        wp_enqueue_media();
                    } else {
                        wp_enqueue_style('thickbox');
                        wp_enqueue_script('media-upload');
                        wp_enqueue_script('thickbox');
                    }
                    $image_id = $field['value'];
                    $image = wp_get_attachment_image($image_id, array(120, 120));
                    $output = !empty($image_id) ? $image : '';
                    $btn_text = !empty($image_id) ? __('Change Image', 'sitesao') : __('Select Image', 'sitesao');
                    echo '<div  class="dh-meta-box-field ' . esc_attr($field['id']) . '_field">';
                    echo '<label for="' . esc_attr($field['id']) . '">' . esc_html($field['label']) . '</label>';
                    echo '<div class="dh-meta-image-thumb">' . $output . '</div>';
                    echo '<input type="hidden" name="' . $field['name'] . '" id="' . $field['id'] . '" value="' . $field['value'] . '" />';
                    echo '<input type="button" class="button button-primary" name="' . $field['id'] . '_button_upload" id="' . $field['id'] . '_upload" value="' . $btn_text . '" /> ';
                    echo '<input type="button" class="button" name="' . $field['id'] . '_button_clear" id="' . $field['id'] . '_clear" value="' . __('Clear Image', 'sitesao') . '" />';
                    if (!empty($field['description'])) {
                        echo '<span class="description">' . dh_print_string($field['description']) . '</span>';
                    }
                    ?>
					<script type="text/javascript">
						jQuery(document).ready(function($) {
							<?php 
                    if (empty($field['value'])) {
                        ?>
 $('#<?php 
                        echo esc_attr($field['id']);
                        ?>
_clear').css('display', 'none'); <?php 
                    }
                    ?>
							$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_upload').on('click', function(event) {
								event.preventDefault();
								var $this = $(this);
		
								// if media frame exists, reopen
								if(dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame) {
									dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame.open();
					                return;
					            }
		
								// create new media frame
								// I decided to create new frame every time to control the selected images
								var dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame = wp.media.frames.wp_media_frame = wp.media({
									title: "<?php 
                    echo __('Select or Upload your Image', 'sitesao');
                    ?>
",
									button: {
										text: "<?php 
                    echo __('Select', 'sitesao');
                    ?>
"
									},
									library: { type: 'image' },
									multiple: false
								});
		
								// when open media frame, add the selected image
								dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame.on('open',function() {
									var selected_id = $this.closest('.dh-meta-box-field').find('#<?php 
                    echo esc_attr($field['id']);
                    ?>
').val();
									if (!selected_id)
										return;
									var selection = dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame.state().get('selection');
									var attachment = wp.media.attachment(selected_id);
									attachment.fetch();
									selection.add( attachment ? [ attachment ] : [] );
								});
		
								// when image selected, run callback
								dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame.on('select', function(){
									var attachment = dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame.state().get('selection').first().toJSON();
									$this.closest('.dh-meta-box-field').find('input#<?php 
                    echo esc_attr($field['id']);
                    ?>
').val(attachment.id);
									var thumbnail = $this.closest('.dh-meta-box-field').find('.dh-meta-image-thumb');
									thumbnail.html('');
									thumbnail.append('<img src="' + attachment.url + '" alt="" />');
		
									$this.attr('value', '<?php 
                    echo __('Change Image', 'sitesao');
                    ?>
');
									$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_clear').css('display', 'inline-block');
								});
		
								// open media frame
								dh_<?php 
                    echo esc_attr($field['id']);
                    ?>
_image_frame.open();
							});
		
							$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_clear').on('click', function(event) {
								var $this = $(this);
								$this.hide();
								$('#<?php 
                    echo esc_attr($field['id']);
                    ?>
_upload').attr('value', '<?php 
                    echo __('Select Image', 'sitesao');
                    ?>
');
								$this.closest('.dh-meta-box-field').find('input#<?php 
                    echo esc_attr($field['id']);
                    ?>
').val('');
								$this.closest('.dh-meta-box-field').find('.dh-meta-image-thumb').html('');
							});
						});
					</script>
								
					<?php 
                    echo '</div>';
                    break;
            }
        }
    }
    echo '</div>';
}
Пример #12
0
 /**
  * Ajax search
  */
 public function search()
 {
     if (empty($_REQUEST['s'])) {
         die;
     }
     $output = "";
     $args = array('post_type' => apply_filters('dh_ajax_search_form_post_type', 'product'), 'post_status' => 'publish', 'post_password' => '', 'suppress_filters' => false, 'numberposts' => 4, 's' => $_REQUEST['s']);
     $args = apply_filters('dh_search_query_args', $args);
     $posts = get_posts($args);
     if (empty($posts)) {
         $output .= '<div class="no-result">';
         $output .= __('No results matched!', 'sitesao');
         $output .= '</div>';
     } else {
         $post_types = array();
         $post_types_object = array();
         foreach ($posts as $post) {
             $post_types[$post->post_type][] = $post;
             if (empty($post_types_object[$post->post_type])) {
                 $post_types_object[$post->post_type] = get_post_type_object($post->post_type);
             }
         }
         $output .= '<div class="searchform-result-list">';
         foreach ($post_types as $ptype => $post_type) {
             if (isset($post_types_object[$ptype]->labels->name)) {
                 $output .= '<h3 class="search-object"><span>' . $post_types_object[$ptype]->labels->name . '</span></h3>';
             } else {
                 $output .= "<hr>";
             }
             foreach ($post_type as $post) {
                 $format = get_post_format($post->ID);
                 if (get_the_post_thumbnail($post->ID, 'thumbnail')) {
                     $image = get_the_post_thumbnail($post->ID, 'thumbnail');
                 } else {
                     if ($format == 'video') {
                         $image = "<i class='fa fa-file-video-o'></i>";
                     } elseif ($format == 'image' || $format == 'gallery') {
                         $image = "<i class='fa fa-file-image-o'></i>";
                     } else {
                         $image = "<i class='fa fa-file-text-o'></i>";
                     }
                 }
                 $excerpt = "";
                 if (!empty($post->post_content)) {
                     $excerpt = wp_html_excerpt(strip_shortcodes($post->post_content), 30, "...");
                 }
                 $link = apply_filters('dh_search_item_url', get_permalink($post->ID));
                 $output .= '<div class="search-entry">';
                 $output .= '<div class="search-image">' . $image . '</div>';
                 $output .= '<div class="search-content">';
                 $output .= '<h4 class="search-title">';
                 $output .= '<a href="' . $link . '">';
                 $output .= get_the_title($post->ID);
                 $output .= '</a>';
                 $output .= '</h4>';
                 $output .= '<span class="search-excerpt">';
                 $output .= $excerpt;
                 $output .= '</span>';
                 $output .= '</div>';
                 $output .= '</div>';
             }
         }
         $output .= '</div>';
         $output .= '<div class="search-view-all"><a href="' . home_url('?s=' . $_REQUEST['s']) . '&post_type=' . (post_type_exists('product') ? 'product' : 'post') . '">' . __('View all results', 'sitesao') . '</a>';
     }
     $output = apply_filters('dh_ajax_search_form_result', $output);
     echo dh_print_string($output);
     die;
 }
Пример #13
0
.footer-copyright a{
	color:<?php 
    echo dh_print_string($custom_colors['footer-link-color']);
    ?>
}
<?php 
}
if (!empty($custom_colors['footer-link-hover'])) {
    ?>
.footer .footer-menu .footer-nav li a:hover, 
.footer .footer-menu .footer-nav li a:focus,
.footer .footer-info a:hover,
.footer .footer-info a:focus,
.footer-copyright a:hover{
	color:<?php 
    echo dh_print_string($custom_colors['footer-link-hover']);
    ?>
}
<?php 
}
?>

<?php 
if (dh_get_theme_option('button-style', 'default') == 'radius') {
    ?>
	.woocommerce .widget_price_filter .price_slider_amount .button,
	.woocommerce.widget_product_search #s, 
	.woocommerce.widget_product_search .search-field,
	.woocommerce.widget_product_search form:before,
	.widget_search form #s,
	.widget_tag_cloud .tagcloud a, .widget_product_tag_cloud .tagcloud a,
Пример #14
0
}
.box-ft-4 .bof-tf-title-wrap .bof-tf-title {
  color: <?php 
echo dh_print_string($brand_primary);
?>
;
}
.box-ft-4 .bof-tf-title-wrap .bof-tf-title-wrap-2 > a:before {
  background: <?php 
echo dh_print_string($brand_primary);
?>
;
}
.box-ft-4 .bof-tf-title-wrap.bg-primary {
  background: <?php 
echo dh_print_string($brand_primary);
?>
;
}
.footer-widget .title-footer span {
  background: <?php 
echo dh_print_string($brand_primary);
?>
;
}
.footer-featured.light i {
  color: <?php 
echo dh_print_string($brand_primary);
?>
;
}
Пример #15
0
<?php

/**
 * Loop Rating
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.0.0
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
global $product;
if (get_option('woocommerce_enable_review_rating') === 'no') {
    return;
}
$rating = $product->get_average_rating();
$rating = absint($rating);
$rating_html = '<div class="star-rating" title="' . sprintf(esc_html__('Rated %s out of 5', 'jakiro'), $rating) . '">';
$rating_html .= '<span style="width:' . $rating / 5 * 100 . '%"><strong class="rating">' . $rating . '</strong> ' . esc_html__('out of 5', 'jakiro') . '</span>';
$rating_html .= '</div>';
echo dh_print_string($rating_html);