function cruxstore_get_product_layout() { $layout = cruxstore_meta('_cruxstore_detail_layout', array(), get_the_ID()); if (!$layout) { $layout = cruxstore_option('product_detail_layout', 'layout1'); } return $layout; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('title' => '', 'layout' => 'square', 'columns_gap' => '15', 'employees_columns' => 3, 'employees_columns_tab' => 2, 'source' => 'all', 'categories' => '', 'posts' => '', 'max_items' => 10, 'orderby' => 'date', 'meta_key' => '', 'order' => 'DESC', 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'employees-wrapper', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'layout' => 'layout-' . $layout); $output = ''; $args = array('order' => $order, 'orderby' => $orderby, 'posts_per_page' => $max_items, 'ignore_sticky_posts' => true, 'post_type' => 'crux_employees'); if ($orderby == 'meta_value' || $orderby == 'meta_value_num') { $args['meta_key'] = $meta_key; } if ($source == 'categories') { if ($categories) { $categories_arr = array_filter(explode(',', $categories)); if (count($categories_arr)) { $args['tax_query'] = array(array('taxonomy' => 'employees-category', 'field' => 'id', 'terms' => $categories_arr)); } } } elseif ($source == 'posts') { if ($posts) { $posts_arr = array_filter(explode(',', $posts)); if (count($posts_arr)) { $args['post__in'] = $posts_arr; } } } $query = new WP_Query($args); if ($query->have_posts()) { $article_columns = 12 / $employees_columns; $article_columns_tab = 12 / $employees_columns_tab; while ($query->have_posts()) { $query->the_post(); $title = sprintf('<h4 class="employees-author">%s</h4>', get_the_title()); $subtitle = cruxstore_meta('_cruxstore_employee_position'); $subtitle = $subtitle ? sprintf('<div class="employees-info">%s</div>', $subtitle) : ''; $socials = ''; if ($email = cruxstore_meta('_cruxstore_employee_email')) { $socials .= sprintf('<a href="%s" target="_blank">%s</a>', 'mailto:' . $email, '<i class="fa fa-envelope-o" aria-hidden="true"></i>'); } if ($facebook = cruxstore_meta('_cruxstore_employee_facebook')) { $socials .= sprintf('<a href="%s" target="_blank">%s</a>', $facebook, '<i class="fa fa-facebook" aria-hidden="true"></i>'); } if ($twitter = cruxstore_meta('_cruxstore_employee_twitter')) { $socials .= sprintf('<a href="%s" target="_blank">%s</a>', $twitter, '<i class="fa fa-twitter" aria-hidden="true"></i>'); } if ($googleplus = cruxstore_meta('_cruxstore_employee_googleplus')) { $socials .= sprintf('<a href="%s" target="_blank">%s</a>', $googleplus, '<i class="fa fa-google-plus" aria-hidden="true"></i>'); } if ($linkedin = cruxstore_meta('_cruxstore_employee_linkedin')) { $socials .= sprintf('<a href="%s" target="_blank">%s</a>', $linkedin, '<i class="fa fa-linkedin" aria-hidden="true"></i>'); } if ($instagram = cruxstore_meta('_cruxstore_employee_instagram')) { $socials .= sprintf('<a href="%s" target="_blank">%s</a>', $instagram, '<i class="fa fa-instagram" aria-hidden="true"></i>'); } if ($socials) { $socials = '<div class="employees-socials">' . $socials . '</div>'; } $image = get_the_post_thumbnail(get_the_ID(), 'cruxstore_square'); if (!$image) { $image = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />'; } if ($layout == 'gallery') { $image = '<div class="employees-img">' . $image . ' </div>'; $employees = sprintf('%s <div class="employees-infos">%s %s</div>', $image, $title, $subtitle . $socials); } else { $image = '<div class="employees-img">' . $image . $socials . ' </div>'; $employees = sprintf('%s <div class="employees-infos">%s %s</div>', $image, $title, $subtitle); } $output .= sprintf('<div class="employees-content col-lg-%1$s col-md-%1$s col-sm-%2$s col-xs-%2$s"><div class="employees-inner">%3$s</div></div>', $article_columns, $article_columns_tab, $employees); } wp_reset_postdata(); } $rowclass = 'row multi-columns-row'; if ($columns_gap == '' || $columns_gap == '0') { $rowclass .= ' no-gutters'; } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '"><div class="' . $rowclass . '">' . $output . '</div></div>'; }
function cruxstore_header_add_class($classes, $header_layout, $header_position) { $header_scheme = ''; if (is_page()) { $header_scheme = cruxstore_meta('_cruxstore_header_scheme', array()); } if (!$header_scheme) { $header_scheme = 'dark'; } $classes .= ' header-' . $header_scheme; if ($header_position == 'transparent') { $classes .= ' header-transparent'; } return $classes; }
/** * Render custom css * * @param $meta * @param $selector * @param null $post_id */ function cruxstore_render_custom_css($meta, $selector, $post_id = null) { $ouput = ''; if (!$post_id) { global $post; $post_id = $post->ID; } $page_bg = cruxstore_meta($meta, array(), $post_id); if (is_array($page_bg)) { $page_arr = array(); $page_color = $page_bg['color']; if ($page_color != '' && $page_color != '#') { $page_arr[] = 'background-color: ' . $page_color; } if ($page_url = $page_bg['url']) { $page_arr[] = 'background-image: url(' . $page_url . ')'; } if ($page_repeat = $page_bg['repeat']) { $page_arr[] = 'background-repeat: ' . $page_repeat; } if ($page_size = $page_bg['size']) { $page_arr[] = 'background-size: ' . $page_size; } if ($page_attachment = $page_bg['attachment']) { $page_arr[] = 'background-attachment: ' . $page_attachment; } if ($page_position = $page_bg['position']) { $page_arr[] = 'background-position: ' . $page_position; } if (count($page_arr)) { $ouput = $selector . '{' . implode(';', $page_arr) . '}'; } } return $ouput; }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('img_size' => 'thumbnail', 'source' => 'all', 'categories' => '', 'posts' => '', 'orderby' => 'date', 'meta_key' => '', 'order' => 'DESC', 'target_link' => '_self', 'image_overlay' => '', 'autoheight' => true, 'autoplay' => false, 'mousedrag' => true, 'autoplayspeed' => 5000, 'slidespeed' => 200, 'desktop' => 4, 'desktopsmall' => 3, 'tablet' => 2, 'mobile' => 1, 'gutters' => true, 'navigation' => true, 'navigation_always_on' => false, 'navigation_position' => 'center-outside', 'navigation_style' => 'normal', 'pagination' => false, 'pagination_position' => 'center-bottom', 'pagination_style' => 'dot-stroke', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts); extract($atts); if ($image_overlay == 'white-boxed') { $atts['gutters'] = false; } $args = array('post_type' => 'crux_client', 'order' => $order, 'orderby' => $orderby, 'posts_per_page' => -1, 'ignore_sticky_posts' => true); if ($orderby == 'meta_value' || $orderby == 'meta_value_num') { $args['meta_key'] = $meta_key; } if ($source == 'categories') { if ($categories) { $categories_arr = array_filter(explode(',', $categories)); if (count($categories_arr)) { $args['tax_query'] = array(array('taxonomy' => 'client-category', 'field' => 'slug', 'terms' => $categories)); } } } elseif ($source == 'posts') { if ($posts) { $posts_arr = array_filter(explode(',', $posts)); if (count($posts_arr)) { $args['post__in'] = $posts_arr; } } } $client_carousel_html = $post_thumbnail = ''; $query = new WP_Query($args); if ($query->have_posts()) { $css_animation = cruxstore_getCSSAnimation($css_animation); $i = 1; while ($query->have_posts()) { $query->the_post(); $link = cruxstore_meta('_cruxstore_link_client'); if ($animation_delay) { $animation_delay_item = sprintf(' data-wow-delay="%sms"', $i * $animation_delay); } else { $animation_delay_item = ''; } if ($link) { $post_thumbnail = '<a target="' . $target_link . '" href="' . $link . '">' . get_the_post_thumbnail(get_the_ID(), $img_size) . '</a>'; } else { $post_thumbnail = get_the_post_thumbnail(get_the_ID(), $img_size, ''); } $client_carousel_html .= sprintf('<div class="%s" %s>%s</div>', 'clients-carousel-item' . $css_animation, $animation_delay_item, $post_thumbnail); $i++; } wp_reset_postdata(); } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'clients-carousel ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); if ($image_overlay) { $elementClass['overlay'] = 'overlay-' . $image_overlay; } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = ''; $output .= '<div class="' . esc_attr($elementClass) . '">'; $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts)); $output .= str_replace('%carousel_html%', $client_carousel_html, $carousel_ouput); $output .= '</div>'; return $output; }
/** * Theme Custom CSS * * @since 1.0 * @return void * @access public */ function cruxstore_setting_script() { $advanced_css = cruxstore_option('advanced_editor_css'); $css = $advanced_css; $styling_link = cruxstore_option('styling_link'); if ($styling_link['hover']) { $css .= 'a:hover,a:focus{color: ' . $styling_link['hover'] . ';}'; } if ($styling_link['active']) { $css .= 'a:active{color: ' . $styling_link['active'] . ';}'; } $is_shop = false; if (is_archive()) { if (cruxstore_is_wc()) { if (is_shop()) { $is_shop = true; } } } if (is_page() || is_singular() || $is_shop || is_home()) { global $post; $post_id = $post->ID; if ($is_shop) { $post_id = get_option('woocommerce_shop_page_id'); } elseif (is_home()) { $post_id = get_option('page_for_posts', true); } $pageh_spacing = cruxstore_meta('_cruxstore_page_top_spacing', array(), $post_id); if ($pageh_spacing != '') { $css .= '.content-area-inner{padding-top: ' . $pageh_spacing . ';}'; } $pageh_spacing = cruxstore_meta('_cruxstore_page_bottom_spacing', array(), $post_id); if ($pageh_spacing != '') { $css .= '.content-area-inner{padding-bottom:' . $pageh_spacing . ';}'; } $pageh_top = cruxstore_meta('_cruxstore_page_header_top', array(), $post_id); if ($pageh_top != '') { $css .= 'div.page-header{padding-top: ' . $pageh_top . ';}'; } $pageh_bottom = cruxstore_meta('_cruxstore_page_header_bottom', array(), $post_id); if ($pageh_bottom != '') { $css .= 'div.page-header{padding-bottom: ' . $pageh_bottom . ';}'; } $pageh_title_color = cruxstore_meta('_cruxstore_page_header_title_color', array(), $post_id); if ($pageh_title_color != '') { $css .= 'div.page-header .page-header-title{color:' . $pageh_title_color . ';}'; } $pageh_subtitle_color = cruxstore_meta('_cruxstore_page_header_subtitle_color', array(), $post_id); if ($pageh_subtitle_color != '') { $css .= 'div.page-header .page-header-subtitle{color:' . $pageh_subtitle_color . ';}'; } $pageh_breadcrumbs_color = cruxstore_meta('_cruxstore_page_header_breadcrumbs_color', array(), $post_id); if ($pageh_breadcrumbs_color != '') { $css .= 'div.page-header .woocommerce-breadcrumb{color:' . $pageh_breadcrumbs_color . ';}'; } $css .= cruxstore_render_custom_css('_cruxstore_page_header_background', 'div.page-header', $post_id); } if ($navigation_space = cruxstore_option('navigation_space', 20)) { $css .= '#nav #main-navigation > li + li{margin-left: ' . $navigation_space . 'px;}'; } if ($mega_border_color = cruxstore_option('mega_border_color', '#ebebeb')) { $mega_border_arr = array('#nav #main-navigation > li .cruxstore-megamenu-wrapper.megamenu-layout-table > ul > li > ul > li', '#nav #main-navigation > li .cruxstore-megamenu-wrapper > ul > li > a', '#nav #main-navigation > li .cruxstore-megamenu-wrapper > ul > li > span', '#nav #main-navigation > li .cruxstore-megamenu-wrapper > ul > li .widget-title', '#nav #main-navigation > li .cruxstore-megamenu-wrapper.megamenu-layout-table > ul > li'); $css .= implode($mega_border_arr, ',') . '{border-color: ' . $mega_border_color . ';}'; } if ($toolbar_color = cruxstore_option('header_toolbar_border_color', '#ebebeb')) { $toolbar_color_arr = array('.topbar', '.top-navigation > li', '.header-container.header-layout8 .top-navigation > li:first-child', '.header-container:not(.header-layout8) .topbar .topbar-right .top-navigation > li:first-child'); $css .= implode($toolbar_color_arr, ',') . '{border-color: ' . $toolbar_color . ';}'; } if ($toolbar_color_light = cruxstore_option('header_toolbar_light_border_color', array('color' => '#f6f6f6', 'alpha' => '.2'))) { $toolbar_color_light_arr = array('.header-transparent.header-light .topbar', '.header-transparent.header-light .top-navigation > li', '.header-transparent.header-light.header-container.header-layout8 .top-navigation > li:first-child', '.header-transparent.header-light.header-container:not(.header-layout8) .topbar .topbar-right .top-navigation > li:first-child'); $css .= implode($toolbar_color_light_arr, ',') . '{border-color: ' . cruxstore_hex2rgba($toolbar_color_light['color'], $toolbar_color_light['alpha']) . ';}'; } if ($navigation_height = cruxstore_option('navigation_height', 102)) { if (isset($navigation_height['height'])) { $navigation_arr = array('#nav #main-nav-socials > li > a', '#nav #main-nav-wc > li > a', '#nav #main-nav-tool > li > a', '#nav #main-navigation > li > a'); $css .= implode($navigation_arr, ',') . '{line-height: ' . intval($navigation_height['height']) . 'px;}'; } } if ($navigation_height_fixed = cruxstore_option('navigation_height_fixed', 102)) { if (isset($navigation_height_fixed['height'])) { $navigation_fixed_arr = array('.is-sticky .apply-sticky #nav #main-nav-socials > li > a', '.is-sticky .apply-sticky #nav #main-nav-wc > li > a', '.is-sticky .apply-sticky #nav #main-nav-tool > li > a', '.is-sticky .apply-sticky #nav #main-navigation > li > a'); $css .= implode($navigation_fixed_arr, ',') . '{line-height: ' . intval($navigation_height_fixed['height']) . 'px;}'; } } $header_sticky_opacity = cruxstore_option('header_sticky_opacity', 0.8); $css .= '.header-sticky-background{opacity:' . $header_sticky_opacity . ';}'; $css .= '@media (max-width: 600px){body.opened-nav-animate.admin-bar #wpadminbar{margin-top:-46px}}'; wp_add_inline_style('cruxstore-main', $css); }
protected function content($atts, $content = null) { $atts = shortcode_atts(array('layout' => '1', 'testimonial_skin' => '', 'font_container' => '', 'use_theme_fonts' => 'yes', 'google_fonts' => '', 'font_container_company' => '', 'use_theme_fonts_company' => 'yes', 'google_fonts_company' => '', 'source' => 'all', 'categories' => '', 'posts' => '', 'max_items' => 10, 'orderby' => 'date', 'meta_key' => '', 'order' => 'DESC', 'autoheight' => true, 'autoplay' => false, 'mousedrag' => true, 'autoplayspeed' => 5000, 'slidespeed' => 200, 'desktop' => 1, 'desktopsmall' => 1, 'tablet' => 1, 'mobile' => 1, 'gutters' => true, 'navigation' => true, 'navigation_always_on' => false, 'navigation_position' => 'center-outside', 'navigation_style' => 'normal', 'pagination' => false, 'pagination_position' => 'center-bottom', 'pagination_style' => 'dot-stroke', 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts); $atts['carousel_skin'] = $atts['testimonial_skin']; extract($atts); $args = array('order' => $order, 'orderby' => $orderby, 'posts_per_page' => $max_items, 'ignore_sticky_posts' => true, 'post_type' => 'crux_testimonial'); if ($orderby == 'meta_value' || $orderby == 'meta_value_num') { $args['meta_key'] = $meta_key; } if ($source == 'categories') { if ($categories) { $categories_arr = array_filter(explode(',', $categories)); if (count($categories_arr)) { $args['tax_query'] = array(array('taxonomy' => 'testimonial-category', 'field' => 'id', 'terms' => $categories_arr)); } } } elseif ($source == 'posts') { if ($posts) { $posts_arr = array_filter(explode(',', $posts)); if (count($posts_arr)) { $args['post__in'] = $posts_arr; } } } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'testimonial-carousel', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'layout' => 'testimonial-layout-' . $layout); $query = new WP_Query($args); $output = ''; if ($query->have_posts()) { $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts)); $carousel_html = ''; while ($query->have_posts()) { $query->the_post(); $testimonial_content = '<div class="testimonial-content">' . do_shortcode(get_the_content()) . '</div>'; $link = cruxstore_meta('_crux_testimonial_link'); $title = get_the_title(); if ($link) { $title = '<a target="_blank" href="' . $link . '">' . $title . '</a>'; } $testimonial_rate = ''; if ($rate = cruxstore_meta('_cruxstore_testimonial_rate')) { $testimonial_rate = '<div class="testimonial-rate rate-' . $rate . '"><span class="star-active"></span></div>'; } $image_size = 'cruxstore_small'; if ($layout == 4) { $image_size = 'cruxstore_grid'; } $testimonial_image = has_post_thumbnail() ? '<div class="testimonial-image">' . get_the_post_thumbnail(null, $image_size) . '</div>' : ''; $company = cruxstore_meta('_cruxstore_testimonial_company'); $testimonial_company = $company ? sprintf('<div class="testimonial-info">%s</div>', $company) : ''; if ($layout == 1 && $testimonial_company) { $title .= ', '; } $testimonial_title = sprintf('<h4 class="testimonial-author">%s</h4>', $title); $testimonial_author = '<div class="testimonial-author-content">' . $testimonial_title . $testimonial_company . '</div>'; if ($layout == '4') { $carousel_html .= sprintf('<div class="testimonial-item">%s %s %s<div class="testimonial-author-infos"> %s</div></div>', $testimonial_image, $testimonial_author, $testimonial_rate, $testimonial_content); } else { $carousel_html .= sprintf('<div class="testimonial-item">%s %s <div class="testimonial-author-infos"> %s</div></div>', $testimonial_image, $testimonial_content, $testimonial_author); } } wp_reset_postdata(); $output .= str_replace('%carousel_html%', $carousel_html, $carousel_ouput); } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>'; }