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 dhecho($gateway->get_title()); ?> <?php echo dhecho($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>' . __('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.', DH_THEME_DOMAIN) . '</p>'; }
.btn-warning:focus.btn-style-3d, .btn-warning:active.btn-style-3d, .btn-warning.active.btn-style-3d { -webkit-box-shadow: 0 5px 0 <?php echo dhecho($darken_12_brand_warning); ?> ; box-shadow: 0 5px 0 <?php echo dhecho($darken_12_brand_warning); ?> ; } .btn-warning.btn-effect-border-fade:hover, .btn-warning.btn-effect-border-fade:focus, .btn-warning.btn-effect-border-fade:active, .btn-warning.btn-effect-border-fade.active { box-shadow: 0 0 0 2px <?php echo dhecho($darken_12_brand_warning); ?> inset, 0 0 1px rgba(0, 0, 0, 0); -moz-box-shadow: 0 0 0 2px <?php echo dhecho($darken_12_brand_warning); ?> inset, 0 0 1px rgba(0, 0, 0, 0); -webkit-box-shadow: 0 0 0 2px <?php echo dhecho($darken_12_brand_warning); ?> inset, 0 0 1px rgba(0, 0, 0, 0); }
?> <?php if (!empty($custom_colors['footer-link-color'])) { ?> .footer .footer-menu .footer-nav li a , .footer .footer-menu .footer-nav li:before, .footer .footer-info a{ color:<?php echo dhecho($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{ color:<?php echo dhecho($custom_colors['footer-link-hover']); ?> } <?php } ?>
</ul> <?php } ?> </li> <?php } ?> <?php do_action('dh_right_topbar_menu'); ?> </ul> </div> <?php } elseif ($right_topbar_content == 'custom') { echo dhecho(dh_get_theme_option('right-topbar-custom-content', '')); } ?> <?php $topbar_social = dh_get_theme_option('topbar-social', 'social_button'); if ($right_topbar_content == 'menu_social') { echo '<div class="topbar-social">'; dh_social(dh_get_theme_option('topbar-social', array('facebook', 'twitter', 'google-plus', 'pinterest', 'rss', 'instagram')), true); echo '</div>'; } ?> </div> </div> </div> </div> </div>
?> <div class="footer-menu"> <?php if (has_nav_menu('footer')) { wp_nav_menu(array('theme_location' => 'footer', 'container' => false, 'depth' => 1, 'menu_class' => 'footer-nav', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'walker' => new DHWalker())); } ?> </div> <?php } ?> <?php if ($footer_copyright = dh_get_theme_option('footer-copyright')) { ?> <div class="copyright"><?php echo dhecho($footer_copyright); ?> </div> <?php } ?> </div> </div> </div> </div> </div> </footer> <?php } ?> </div>
.btn-danger:focus.btn-style-3d, .btn-danger:active.btn-style-3d, .btn-danger.active.btn-style-3d { -webkit-box-shadow: 0 5px 0 <?php echo dhecho($darken_10_brand_danger); ?> ; box-shadow: 0 5px 0 <?php echo dhecho($darken_10_brand_danger); ?> ; } .btn-danger.btn-effect-border-fade:hover, .btn-danger.btn-effect-border-fade:focus, .btn-danger.btn-effect-border-fade:active, .btn-danger.btn-effect-border-fade.active { box-shadow: 0 0 0 2px <?php echo dhecho($darken_10_brand_danger); ?> inset, 0 0 1px rgba(0, 0, 0, 0); -moz-box-shadow: 0 0 0 2px <?php echo dhecho($darken_10_brand_danger); ?> inset, 0 0 1px rgba(0, 0, 0, 0); -webkit-box-shadow: 0 0 0 2px <?php echo dhecho($darken_10_brand_danger); ?> inset, 0 0 1px rgba(0, 0, 0, 0); }
; } <?php //10 ?> a.text-primary:hover { color: <?php echo dhecho($darken_10_brand_primary); ?> ; } a.bg-primary:hover { background-color: <?php echo dhecho($darken_10_brand_primary); ?> ; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: <?php echo dhecho($darken_10_brand_primary); ?> ; } a[data-toggle="popover"]:hover, a[data-toggle="tooltip"]:hover { color: <?php echo dhecho($darken_10_brand_primary); ?> ; }
* * @author WooThemes * @package WooCommerce/Templates * @version 2.2 */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly } if (!WC()->cart->coupons_enabled()) { return; } $info_message = apply_filters('woocommerce_checkout_coupon_message', __('Have a coupon?', DH_THEME_DOMAIN) . ' <a href="#" class="showcoupon">' . __('Click here to enter your code', DH_THEME_DOMAIN) . '</a>'); ?> <div class="woocommerce-info woocommerce-info-coupon"><?php echo dhecho($info_message); ?> </div> <form class="checkout_coupon" method="post" style="display:none"> <p class="form-row form-row-first"> <input type="text" name="coupon_code" class="input-text" placeholder="<?php _e('Coupon code', DH_THEME_DOMAIN); ?> " id="coupon_code" value="" /> </p> <p class="form-row form-row-last"> <input type="submit" class="button" name="apply_coupon" value="<?php _e('Apply Coupon', DH_THEME_DOMAIN); ?>
/** * Ajax search */ public function search() { if (empty($_REQUEST['s'])) { die; } $output = ""; $args = array('post_type' => 'any', '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!', DH_DOMAIN); $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']) . '">' . __('View all results', DH_DOMAIN) . '</a>'; } $output = apply_filters('dh_ajax_search_form_result', $output); echo dhecho($output); die; }
?> <div class="<?php dh_container_class(); ?> "> <div class="row heading-wrap"> <div class="col-md-12 page-title parallax-content"> <h1><?php echo esc_html($page_heading_title); ?> </h1> <?php if (!empty($page_heading_sub_title)) { ?> <span class="subtitle"><?php echo dhecho($page_heading_sub_title); ?> </span> <?php } ?> </div> </div> </div> </div> </div> <?php } else { ?> <div<?php echo !empty($heading_menu_anchor) ? ' id ="' . esc_attr($heading_menu_anchor) . '"' : '';
<?php do_action('woocommerce_before_add_to_cart_button'); ?> <div class="single_variation_wrap" style="display:none;"> <?php do_action('woocommerce_before_single_variation'); ?> <div class="single_variation"></div> <div class="variations_button"> <?php woocommerce_quantity_input(); ?> <button type="submit" class="single_add_to_cart_button button alt"><?php echo dhecho($product->single_add_to_cart_text()); ?> </button> </div> <input type="hidden" name="add-to-cart" value="<?php echo esc_attr($product->id); ?> " /> <input type="hidden" name="product_id" value="<?php echo esc_attr($post->ID); ?> " /> <input type="hidden" name="variation_id" class="variation_id" value="" /> <?php do_action('woocommerce_after_single_variation');
echo get_category_parents($cat, true, '' . $delimiter); echo dhecho($before) . '<span typeof="v:Breadcrumb"><a href="' . get_permalink($parent) . '" property="v:title" rel="v:url"><span>' . $parent->post_title . '</span></a></span>' . dhecho($after) . $delimiter; echo dhecho($before) . get_the_title() . dhecho($after); } elseif (is_page() && !$post->post_parent) { echo dhecho($before) . '<span typeof="v:Breadcrumb" property="v:title">' . get_the_title() . '</span>' . dhecho($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 dhecho($crumb) . '' . $delimiter; } echo dhecho($before) . '<span typeof="v:Breadcrumb" property="v:title">' . get_the_title() . '</span>' . dhecho($after); } elseif (is_search()) { echo dhecho($before) . '<span typeof="v:Breadcrumb" property="v:title">' . __('Search results for “', DH_THEME_DOMAIN) . get_search_query() . '”' . '</span>' . dhecho($after); } elseif (is_tag()) { echo dhecho($before) . '<span typeof="v:Breadcrumb" property="v:title">' . __('Posts tagged “', DH_THEME_DOMAIN) . single_tag_title('', false) . '”' . '</span>' . dhecho($after); } elseif (is_author()) { $userdata = get_userdata($author); echo dhecho($before) . '<span typeof="v:Breadcrumb" property="v:title">' . __('Author:', DH_THEME_DOMAIN) . ' ' . $userdata->display_name . '</span>' . dhecho($after); } if (get_query_var('paged')) { echo '<span typeof="v:Breadcrumb" property="v:title">' . ' (' . __('Page', DH_THEME_DOMAIN) . ' ' . get_query_var('paged') . ')' . '</span>'; } echo dhecho($wrap_after); }
<?php /** * External product add to cart * * @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'); ?> <p class="cart"> <a href="<?php echo esc_url($product_url); ?> " rel="nofollow" class="single_add_to_cart_button button alt"><?php echo dhecho($button_text); ?> </a> </p> <?php do_action('woocommerce_after_add_to_cart_button');
<?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(__('Rated %s out of 5', DH_THEME_DOMAIN), $rating) . '">'; $rating_html .= '<span style="width:' . $rating / 5 * 100 . '%"><strong class="rating">' . $rating . '</strong> ' . __('out of 5', DH_THEME_DOMAIN) . '</span>'; $rating_html .= '</div>'; echo dhecho($rating_html);
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">' . dhecho($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">' . dhecho($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">' . dhecho($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">' . dhecho($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...', DH_DOMAIN) . '</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">' . dhecho($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">' . dhecho($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">' . dhecho($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', DH_DOMAIN); ?> ', button: { text: '<?php echo __('Add to Gallery', DH_DOMAIN); ?> ', }, 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', DH_DOMAIN); ?> "><?php echo __('x', DH_DOMAIN); ?> </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', DH_DOMAIN); ?> " href="#"><?php echo __('x', DH_DOMAIN); ?> </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', DH_DOMAIN) . '" /> '; if (!empty($field['description'])) { echo '<span class="description">' . dhecho($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', DH_DOMAIN) : __('Select Media', DH_DOMAIN); 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', DH_DOMAIN) . '" />'; if (!empty($field['description'])) { echo '<span class="description">' . dhecho($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', DH_DOMAIN); ?> ", button: { text: "<?php echo __('Select', DH_DOMAIN); ?> " }, 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', DH_DOMAIN); ?> '); $('#<?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', DH_DOMAIN); ?> '); $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', DH_DOMAIN) : __('Select Image', DH_DOMAIN); 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', DH_DOMAIN) . '" />'; if (!empty($field['description'])) { echo '<span class="description">' . dhecho($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', DH_DOMAIN); ?> ", button: { text: "<?php echo __('Select', DH_DOMAIN); ?> " }, 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', DH_DOMAIN); ?> '); $('#<?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', DH_DOMAIN); ?> '); $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>'; }
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'] : '960'; $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 parallax-content"> <?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 dhecho($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'); $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'); ?> <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); ?> btn-style-<?php echo esc_attr($button_primary_style); ?> "><?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); ?> btn-style-<?php echo esc_attr($button_secondary_style); ?> "><?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; }
$loop = 1; foreach ($attachment_ids as $attachment_id) { $image = wp_get_attachment_image($attachment_id, apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail')); $image_title = esc_attr(get_the_title($attachment_id)); ?> <li class="caroufredsel-item"> <div class="thumb"> <a href="#" data-rel="<?php echo esc_attr($loop); ?> " title="<?php echo esc_attr($image_title); ?> "> <?php echo dhecho($image); ?> </a> </div> </li> <?php $loop++; } ?> </ul> <a href="#" class="caroufredsel-prev"></a> <a href="#" class="caroufredsel-next"></a> </div> </div> </div> <?php
.btn-success:focus.btn-style-3d, .btn-success:active.btn-style-3d, .btn-success.active.btn-style-3d { -webkit-box-shadow: 0 5px 0 <?php echo dhecho($darken_12_brand_success); ?> ; box-shadow: 0 5px 0 <?php echo dhecho($darken_12_brand_success); ?> ; } .btn-success.btn-effect-border-fade:hover, .btn-success.btn-effect-border-fade:focus, .btn-success.btn-effect-border-fade:active, .btn-success.btn-effect-border-fade.active { box-shadow: 0 0 0 2px <?php echo dhecho($darken_12_brand_success); ?> inset, 0 0 1px rgba(0, 0, 0, 0); -moz-box-shadow: 0 0 0 2px <?php echo dhecho($darken_12_brand_success); ?> inset, 0 0 1px rgba(0, 0, 0, 0); -webkit-box-shadow: 0 0 0 2px <?php echo dhecho($darken_12_brand_success); ?> inset, 0 0 1px rgba(0, 0, 0, 0); }
function dh_mailchimp_form($echo = true) { ob_start(); ?> <form 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">' . __('Not Subscribe to Mailchimp!', DH_DOMAIN) . '<span>'; } elseif ($mailchimp_subscribe == 1) { echo '<span class="success">' . __('Subscribe to Mailchimp Successful!', DH_DOMAIN) . '</span>'; } ?> </div> <?php } ?> <div class="mailchimp-form-content clearfix"> <div class="row"> <div class="col-sm-8"> <label for="" class="hide"><?php _e('Subscribe', DH_DOMAIN); ?> </label> <input type="email" class="form-control" required="required" autocomplete="off" placeholder="<?php _e('Enter your email...', DH_DOMAIN); ?> " name="email"> </div> <div class="col-sm-4"> <button type="submit" class="btn btn-primary"><?php _e('Subscribe', DH_DOMAIN); ?> </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 dhecho($form); } else { return $form; } }
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', DH_DOMAIN); ?> </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!', DH_DOMAIN); ?> </em> <button id="dh-opt-submit" name="dh_opt_save" class="button-primary" type="submit"><?php echo __('Save All Change', DH_DOMAIN); ?> </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 dhecho($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 dhecho($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 dhecho($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', DH_DOMAIN); ?> </button> <button id="dh-opt-reset" name="<?php echo self::$_option_name; ?> [dh_opt_reset]" class="button" type="submit"><?php echo __('Reset Options', DH_DOMAIN); ?> </button> </div> <div class="clear"></div> </form> </div> <?php }