$tile = get_post_meta($post_id, '_appica_portfolio_tile', true); $cat_classes = appica_get_class_set($categories); $tile_classes = array('grid-item', $cat_classes); unset($cat_classes); /** * Associated tile formats and classes * @var array */ $formats = array('default' => '', 'wide' => 'w2', 'king-size' => 'w2 h2'); // format extra classes $format = 'default'; if (array_key_exists('format', $tile) && array_key_exists($tile['format'], $formats)) { $format = (string) $tile['format']; $tile_classes[] = $formats[$format]; } $tile_classes = appica_get_class_set($tile_classes); ?> <div class="<?php echo $tile_classes; ?> "> <div class="portfolio-tile"> <div class="tile-thumb" style="background-image: url(<?php echo $image_large_url; ?> );"> <div class="overlay"> <?php if ('default' === $format) { ?>
} if ('' !== $badge_fs) { $badge_style_rules['font-size'] = "{$badge_fs}px"; } $badge_style = sprintf('style="%s"', appica_generate_css($badge_style_rules)); $badge_classes = appica_get_class_set(array('badge', 'right' === $badge_align ? 'badge-reverse' : '', '' === $badge_cc && 'default' === $badge_pc ? '' : $badge_pc, $badge_class)); $badge_icon = '' === $badge_cc ? sprintf('<span class="icon"><i class="%s"></i></span>', $badge_icon) : sprintf('<span class="icon" style="background: %1$s !important;"><i class="%2$s"></i></span>', $badge_cc, $badge_icon); // 1 - title, 2 - icon, 3 - class set, 4 - inline css $badge_tpl = 'right' === $badge_align ? '<div class="%3$s" %4$s>%1$s%2$s</div>' : '<div class="%3$s" %4$s>%2$s%1$s</div>'; $badge_html = sprintf($badge_tpl, $badge_title, $badge_icon, $badge_classes, $badge_style); unset($badge, $badge_align, $badge_title, $badge_cc, $badge_pc, $badge_class, $badge_classes, $badge_style, $badge_icon, $badge_tpl, $badge_btc, $badge_tc, $badge_style_rules); } /* * Prepare ROW class set */ $row_classes = appica_get_class_set(array('fw-bg', 'vc_row', get_row_css_class(), $is_inner ? 'vc_inner ' : '', $row_custom_css_class, $this->getExtraClass($el_class), 'light' === $content_color ? 'light-color' : '', $overlay ? 'overlay' : '', $is_overlay_part ? 'partial-overlay' : '')); $row_classes = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $row_classes, $this->settings['base'], $atts); /* * Start output .vc_row * 1 - ID, 2 - classes, 3 - overlay css, 4 - badge */ $output .= sprintf('<div id="%1$s" class="%2$s" data-vc-full-width="true" data-vc-stretch-content="true" data-overlay="%3$s">', esc_attr($uniq_id), $row_classes, $overlay_style); // wrap to .container, if need if (false === $is_inner && $is_container) { $output .= sprintf('<div class="container">%s<div class="row">', $badge_html); } $output .= wpb_js_remove_wpautop($content); if (false === $is_inner && $is_container) { $output .= '</div></div>'; } $output .= '</div><div class="vc_row-full-width"></div>';
// Append extra class to <figure> $img_wrapper_class[] = $caption_class; $caption = "<figcaption>{$caption_line}</figcaption>"; // Append <figcaption> to the img output $img_output .= $caption; } // Prepare the Wrapper class set $img_wrapper_class = appica_get_class_set($img_wrapper_class); if (!empty($link_to)) { // 1 - class, 2 - href, 3 - target, 4 - class set, 5 - img output, 6 - wrapper tag $_template = '<a%1$s href="%2$s" target="%3$s"><%6$s class="%4$s">%5$s</%6$s></a>'; $image_string = sprintf($_template, $a_class, $link_to, $img_link_target, $img_wrapper_class, $img_output, $img_wrapper_tag); } else { // 1 - img output, 2 - class set, 3 - wrapper tag $_template = '<%3$s class="%2$s">%1$s</%3$s>'; $image_string = sprintf($_template, $img_output, $img_wrapper_class, $img_wrapper_tag); } // Delete unnecessary classes unset($_template, $img_wrapper_tag, $img_wrapper_class, $caption); $css_class = array(); $css_class[] = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element' . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts); $css_class[] = $this->getCSSAnimation($css_animation); $css_class[] = 'vc_align_' . $alignment; $css_class = appica_get_class_set($css_class); $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= "\n\t\t\t" . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_singleimage_heading')); $output .= "\n\t\t\t" . $image_string; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_single_image'); echo $output;
*/ $tabs_content_set_class = array('col-sm-6'); if ($is_tour) { $tabs_content_set_class[0] = 'col-lg-8'; $tabs_content_set_class[] = 'col-md-9'; $tabs_content_set_class[] = 'col-sm-8'; // add offset for "right" content position $tabs_content_set_class[] = $is_left ? '' : 'col-lg-offset-1'; } /** * Class set for content column. * Add offset if content has "right" position. * * @var string */ $tabs_content_col_class = appica_get_class_set($tabs_content_set_class); $tabs_content .= sprintf('<div class="%s">', $tabs_content_col_class); $tabs_content .= '<div class="tab-content">'; $tabs_content .= wpb_js_remove_wpautop($content); $tabs_content .= '</div>'; $tabs_content .= '</div>'; // end tabs content column, close .col-* if ($is_left) { echo $tabs_content, $tabs_column; } else { echo $tabs_column, $tabs_content; } /* * Close wrapper for extra class */ if ('' !== $el_class) {
/** * Get post tile class set, based on if post is wide. * * @param bool $is_wide Check if post is wide * * @return string Class set for post tile wrapper */ function appica_get_post_class_set($is_wide = false) { $class = appica_get_class_set(array('item', $is_wide ? 'w2' : '')); return $class; }
/** * Output an Appica 2 theme specific comment template. * * @author 8guild * @since 1.0.0 * @see wp_list_comments() * * @param object $comment Comment to display. * @param array $args An array of arguments. * @param int $depth Depth of comment. */ function appica_comment($comment, $args, $depth) { // Open tag $tag = 'div' === $args['style'] ? 'div' : 'li'; // Extra comment wrap class $extra_class = appica_get_class_set(array($args['has_children'] ? 'parent' : '')); ?> <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?> " <?php comment_class($extra_class); ?> > <div class="comment-meta"> <div class="column"> <div class="author vcard"> <?php if (0 != $args['avatar_size']) { ?> <span class="ava"><?php echo get_avatar($comment, $args['avatar_size']); ?> </span> <?php } ?> <span><?php _e('by', 'appica'); ?> </span> <span class="fake-link"><?php comment_author(); ?> </span> </div> </div> <div class="column text-right"> <span><?php echo human_time_diff(get_comment_time('U'), current_time('timestamp')), ' '; _e('ago', 'appica'); ?> </span> <?php comment_reply_link(array_merge($args, array('add_below' => 'comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '', 'after' => ''))); ?> </div> </div> <?php if ('0' == $comment->comment_approved) { ?> <p class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'appica'); ?> </p> <?php } ?> <?php comment_text(); }
<?php /** * Shortcode vc_tab custom output * * @since 1.0.0 * * @author 8guild * @package Appica * @subpackage Visual Composer */ $a = shortcode_atts(array('tab_id' => '', 'title' => '', 'transition' => ''), $atts); $title = esc_html($a['title']); $tab_id = '' === $a['tab_id'] ? sanitize_title($title) : $a['tab_id']; // transition effect $transit = trim($a['transition'], '_'); $transit = '' === $transit || 'fade' === $transit ? '' : esc_html($transit); $content = '' === trim($content) ? __('Empty tab. Edit page to add content here.', 'appica') : wpb_js_remove_wpautop($content); $class = appica_get_class_set(array('tab-pane', 'transition', 'fade', $transit)); printf('<div class="%3$s" id="tab-%1$s">%2$s</div>', $tab_id, $content, $class);