Ejemplo n.º 1
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     extract(shortcode_atts(array('tag' => 'h3', 'padding' => '5', 'heading' => '', 'color' => '', 'style' => '', 'custom_font' => '', 'size' => '', 'subheading_active' => '', 'subheading_size' => ''), $atts, $this->config['shortcode']));
     $output = "";
     $styling = "";
     $subheading = "";
     $border_styling = "";
     $before = $after = "";
     $class = $meta['el_class'];
     $subheading_extra = "";
     if ($heading) {
         // add seo markup
         $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
         // filter heading for & symbol and convert them
         $heading = apply_filters('avia_ampersand', wptexturize($heading));
         //if the heading contains a strong tag make apply a custom class that makes the rest of the font appear smaller for a better effect
         if (strpos($heading, '<strong>') !== false) {
             $class .= " av-thin-font";
         }
         //apply the padding bottom styling
         $styling .= "padding-bottom:{$padding}px;";
         // if the color is a custom hex value add the styling for both border and font
         if ($color == "custom-color-heading" && $custom_font) {
             $styling .= "color:{$custom_font};";
             $border_styling = "style='border-color:{$custom_font}'";
             $subheading_extra = "av_custom_color";
         }
         // if a custom font size is set apply it to the container and also apply the inherit class so the actual heading uses the size
         if (!empty($style) && !empty($size)) {
             $styling .= "font-size:{$size}px;";
             $class .= " av-inherit-size";
         }
         //finish up the styling string
         if (!empty($styling)) {
             $styling = "style='{$styling}'";
         }
         //check if we got a subheading
         if (!empty($subheading_active) && !empty($content)) {
             $content = "<div class ='av-subheading av-{$subheading_active} {$subheading_extra}' style='font-size:{$subheading_size}px;'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
             if ($subheading_active == "subheading_above") {
                 $before = $content;
             } else {
                 $after = $content;
             }
         }
         //html markup
         $output .= "<div {$styling} class='av-special-heading av-special-heading-{$tag} {$color} {$style} {$class}'>";
         $output .= $before;
         $output .= "<{$tag} class='av-special-heading-tag' {$markup} >{$heading}</{$tag}>";
         $output .= $after;
         $output .= "<div class='special-heading-border'><div class='special-heading-inner-border' {$border_styling}></div></div>";
         $output .= "</div>";
     }
     return $output;
 }
Ejemplo n.º 2
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     $output = '';
     $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $markup_text = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $output .= '<section class="av_textblock_section" ' . $markup . '>';
     $output .= "<div class='avia_textblock {$custom_class}' {$markup_text}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     $output .= '</section>';
     return $output;
 }
Ejemplo n.º 3
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     $atts = shortcode_atts(array('wrapper_element' => '', 'deactivate_wrapper' => false, 'wrapper_element_attributes' => ''), $atts, $this->config['shortcode']);
     $content = ' [avia_codeblock_placeholder uid="' . avia_sc_codeblock::$codeblock_id . '"] ';
     if (!empty($atts['wrapper_element'])) {
         $content = "<{$atts['wrapper_element']} {$atts['wrapper_element_attributes']}>{$content}</{$atts['wrapper_element']}>";
     }
     if (empty($atts['deactivate_wrapper'])) {
         $output = '';
         $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
         $markup_text = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
         $output .= '<section class="avia_codeblock_section avia_code_block_' . avia_sc_codeblock::$codeblock_id . '" ' . $markup . '>';
         $output .= "<div class='avia_codeblock {$custom_class}' {$markup_text}>" . $content . "</div>";
         $output .= '</section>';
         $content = $output;
     }
     avia_sc_codeblock::$codeblock_id++;
     return $content;
 }
Ejemplo n.º 4
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     extract(shortcode_atts(array('font_color' => "", 'color' => '', 'size' => ''), $atts, $this->config['shortcode']));
     $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     $output = '';
     $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $markup_text = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $extra_styling = "";
     if ($size) {
         $extra_styling .= "font-size:{$size}px; ";
     }
     if ($font_color == "custom") {
         $custom_class .= " av_inherit_color";
         $extra_styling .= !empty($color) ? "color:{$color}; " : "";
     }
     if ($extra_styling) {
         $extra_styling = " style='{$extra_styling}'";
     }
     $output .= '<section class="av_textblock_section" ' . $markup . '>';
     $output .= "<div class='avia_textblock {$custom_class}' {$extra_styling} {$markup_text}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     $output .= '</section>';
     return $output;
 }
Ejemplo n.º 5
0
 public function html()
 {
     global $avia_config;
     $output = "";
     if (empty($this->entries) || empty($this->entries->posts)) {
         return $output;
     }
     avia_post_slider::$slide++;
     extract($this->atts);
     if ($preview_mode == 'auto') {
         $image_size = 'portfolio';
     }
     $extraClass = 'first';
     $grid = 'one_third';
     $post_loop_count = 1;
     $loop_counter = 1;
     $autoplay = $autoplay == "no" ? false : true;
     $total = $columns % 2 ? "odd" : "even";
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             if ($preview_mode == 'auto') {
                 $image_size = 'large';
             }
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             if ($preview_mode == 'auto') {
                 $image_size = 'portfolio_small';
             }
             break;
         case "5":
             $grid = 'av_one_fifth';
             if ($preview_mode == 'auto') {
                 $image_size = 'portfolio_small';
             }
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation, 'show_slide_delay' => 90));
     $thumb_fallback = "";
     $markup = avia_markup_helper(array('context' => 'blog', 'echo' => false, 'custom_markup' => $custom_markup));
     $output .= "<div {$data} class='avia-content-slider avia-content-{$type}-active avia-content-slider" . avia_post_slider::$slide . " avia-content-slider-{$total} {$class}' {$markup}>";
     $output .= "<div class='avia-content-slider-inner'>";
     foreach ($this->entries->posts as $entry) {
         $the_id = $entry->ID;
         $parity = $loop_counter % 2 ? 'odd' : 'even';
         $last = $this->entries->post_count == $post_loop_count ? " post-entry-last " : "";
         $post_class = "post-entry post-entry-{$the_id} slide-entry-overview slide-loop-{$post_loop_count} slide-parity-{$parity} {$last}";
         $link = get_permalink($the_id);
         $excerpt = "";
         $title = '';
         $show_meta = !is_post_type_hierarchical($entry->post_type);
         $commentCount = get_comments_number($the_id);
         $thumbnail = get_the_post_thumbnail($the_id, $image_size);
         $format = get_post_format($the_id);
         if (empty($format)) {
             $format = "standard";
         }
         if ($thumbnail) {
             $thumb_fallback = $thumbnail;
             $thumb_class = "real-thumbnail";
         } else {
             $thumbnail = "<span class=' fallback-post-type-icon' " . av_icon_string($format) . "></span><span class='slider-fallback-image'>{{thumbnail}}</span>";
             $thumb_class = "fake-thumbnail";
         }
         $permalink = '<div class="read-more-link"><a href="' . get_permalink($the_id) . '" class="more-link">' . __('Read more', 'avia_framework') . '<span class="more-link-arrow">  &rarr;</span></a></div>';
         $prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters('avf_postgrid_excerpt_length', 60), apply_filters('avf_postgrid_excerpt_delimiter', " "), "…", true, '');
         if ($format == 'link') {
             $current_post = array();
             $current_post['content'] = $entry->post_content;
             $current_post['title'] = $entry->post_title;
             if (function_exists('avia_link_content_filter')) {
                 $current_post = avia_link_content_filter($current_post);
             }
             $link = $current_post['url'];
         }
         switch ($contents) {
             case "excerpt":
                 $excerpt = $prepare_excerpt;
                 $title = $entry->post_title;
                 break;
             case "excerpt_read_more":
                 $excerpt = $prepare_excerpt;
                 $excerpt .= $permalink;
                 $title = $entry->post_title;
                 break;
             case "title":
                 $excerpt = '';
                 $title = $entry->post_title;
                 break;
             case "title_read_more":
                 $excerpt = $permalink;
                 $title = $entry->post_title;
                 break;
             case "only_excerpt":
                 $excerpt = $prepare_excerpt;
                 $title = '';
                 break;
             case "only_excerpt_read_more":
                 $excerpt = $prepare_excerpt;
                 $excerpt .= $permalink;
                 $title = '';
                 break;
             case "no":
                 $excerpt = '';
                 $title = '';
                 break;
         }
         if ($loop_counter == 1) {
             $output .= "<div class='slide-entry-wrap'>";
         }
         $post_format = get_post_format($the_id) ? get_post_format($the_id) : 'standard';
         $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
         $output .= "<article class='slide-entry flex_column {$style} {$post_class} {$grid} {$extraClass} {$thumb_class}' {$markup}>";
         $output .= $thumbnail ? "<a href='{$link}' data-rel='slide-" . avia_post_slider::$slide . "' class='slide-image' title=''>{$thumbnail}</a>" : "";
         if ($post_format == "audio") {
             $current_post = array();
             $current_post['content'] = $entry->post_content;
             $current_post['title'] = $entry->post_title;
             $current_post = apply_filters('post-format-' . $post_format, $current_post);
             if (!empty($current_post['before_content'])) {
                 $output .= '<div class="big-preview single-big audio-preview">' . $current_post['before_content'] . '</div>';
             }
         }
         $output .= "<div class='slide-content'>";
         $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
         $output .= '<header class="entry-content-header">';
         $output .= !empty($title) ? "<h3 class='slide-entry-title entry-title' {$markup}><a href='{$link}' title='" . esc_attr(strip_tags($title)) . "'>" . $title . "</a></h3>" : '';
         $output .= '</header>';
         if ($show_meta && !empty($excerpt)) {
             $output .= "<div class='slide-meta'>";
             if ($commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') {
                 $link_add = $commentCount === "0" ? "#respond" : "#comments";
                 $text_add = $commentCount === "1" ? __('Comment', 'avia_framework') : __('Comments', 'avia_framework');
                 $output .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add}</a></div><div class='slide-meta-del'>/</div>";
             }
             $markup = avia_markup_helper(array('context' => 'entry_time', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
             $output .= "<time class='slide-meta-time updated' {$markup}>" . get_the_time(get_option('date_format'), $the_id) . "</time>";
             $output .= "</div>";
         }
         $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
         $excerpt = apply_filters('avf_post_slider_entry_excerpt', $excerpt, $prepare_excerpt, $permalink, $entry);
         $output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' {$markup}>" . $excerpt . "</div>" : "";
         $output .= "</div>";
         $output .= '<footer class="entry-footer"></footer>';
         $output .= "</article>";
         $loop_counter++;
         $post_loop_count++;
         $extraClass = "";
         if ($loop_counter > $columns) {
             $loop_counter = 1;
             $extraClass = 'first';
         }
         if ($loop_counter == 1 || !empty($last)) {
             $output .= "</div>";
         }
     }
     $output .= "</div>";
     if ($post_loop_count - 1 > $columns && $type == 'slider') {
         $output .= $this->slide_navigation_arrows();
     }
     if ($use_main_query_pagination == 'yes' && $paginate == "yes") {
         global $wp_query;
         $avia_pagination = avia_pagination($wp_query->max_num_pages, 'nav');
     } else {
         if ($paginate == "yes") {
             $avia_pagination = avia_pagination($this->entries->max_num_pages, 'nav');
         }
     }
     if (!empty($avia_pagination)) {
         $output .= "<div class='pagination-wrap pagination-slider'>{$avia_pagination}</div>";
     }
     $output .= "</div>";
     $output = str_replace('{{thumbnail}}', $thumb_fallback, $output);
     wp_reset_query();
     return $output;
 }
<?php

global $avia_config;
$author_id = get_query_var('author');
if (empty($author_id)) {
    $author_id = get_the_author_meta('ID');
}
$name = apply_filters('avf_author_name', get_the_author_meta('display_name', $author_id), $author_id);
$email = apply_filters('avf_author_email', get_the_author_meta('email', $author_id), $author_id);
$gravatar_alt = esc_html($name);
$gravatar = get_avatar($email, '81', '', $gravatar_alt);
$name = "<span class='author-box-name' " . avia_markup_helper(array('context' => 'author_name', 'echo' => false)) . ">" . $name . "</span>";
$heading = __("About", 'avia_framework') . " " . $name;
$description = apply_filters('avf_author_description', get_the_author_meta('description', $author_id), $author_id);
echo '<section class="author-box" ' . avia_markup_helper(array('context' => 'author', 'echo' => false)) . '>';
if (empty($description)) {
    $description = __("This author has yet to write their bio.", 'avia_framework');
    $description .= '</br>' . sprintf(__('Meanwhile lets just say that we are proud %s contributed a whooping %s entries.', 'avia_framework'), $name, count_user_posts($author_id));
    if (current_user_can('edit_users') || get_current_user_id() == $author_id) {
        $description .= "</br><a href='" . admin_url('profile.php?user_id=' . $author_id) . "'>" . __('Edit the profile description here.', 'avia_framework') . "</a>";
    }
}
echo "<span class='post-author-format-type blog-meta'><span class='rounded-container'>{$gravatar}</span></span>";
echo "<div class='author_description '>\n        <h3 class='author-title'>{$heading}</h3>\n        <div class='author_description_text'" . avia_markup_helper(array('context' => 'description', 'echo' => false)) . ">" . wpautop($description) . "</div><span class='author-extra-border'></span></div>";
echo '</section>';
Ejemplo n.º 7
0
 function render_entry($entry, $style)
 {
     $output = "";
     $image = get_the_post_thumbnail($entry->ID, $this->atts['image_size'][$style]);
     $link = get_permalink($entry->ID);
     $titleAttr = "title='" . __('Link to:', 'avia_framework') . " " . the_title_attribute('echo=0') . "'";
     $title = "<a href='{$link}' {$titleAttr}>" . get_the_title($entry->ID) . "</a>";
     $titleTag = "h3";
     $excerpt = "";
     $time = get_the_time(get_option('date_format'), $entry->ID);
     $separator = "<span class='av-magazine-text-sep text-sep-date'>/</span>";
     $author = apply_filters('avf_author_name', get_the_author_meta('display_name', $entry->post_author), $entry->post_author);
     $author = "<span class='av-magazine-author meta-color vcard author'><span class='fn'>" . __('by', 'avia_framework') . ' ' . $author . "</span></span>";
     $markupEntry = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $entry->ID, 'custom_markup' => $this->atts['custom_markup']));
     $markupTitle = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $entry->ID, 'custom_markup' => $this->atts['custom_markup']));
     $markupContent = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $entry->ID, 'custom_markup' => $this->atts['custom_markup']));
     $markupTime = avia_markup_helper(array('context' => 'entry_time', 'echo' => false, 'id' => $entry->ID, 'custom_markup' => $this->atts['custom_markup']));
     $format = get_post_format($entry->ID) ? get_post_format($entry->ID) : 'standard';
     $type = get_post_type($entry->ID);
     $icontype = $type == 'post' ? $format : $type;
     $icon = "<a href='{$link}' {$titleAttr} class='iconfont av-magazine-entry-icon' " . av_icon_string($icontype) . "></a>";
     $extraClass = "";
     if ($style == 'small') {
         if (empty($this->atts['thumbnails'])) {
             $image = "";
             $extraClass = "av-magazine-no-thumb";
         }
     } else {
         $excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters('avf_magazine_excerpt_length', 60), apply_filters('avf_magazine_excerpt_delimiter', " "), "…", true, '');
     }
     $output .= "<article class='av-magazine-entry av-magazine-entry-id-" . $entry->ID . " av-magazine-format-{$format} av-magazine-type-{$type} av-magazine-entry-" . $entry->loop . " av-magazine-entry-" . $style . " {$extraClass}' {$markupEntry}>";
     if ($this->atts['thumbnails'] || $style == 'big' && $image) {
         $output .= "<div class='av-magazine-thumbnail'>";
         if ($image) {
             $output .= "<a href='{$link}' {$titleAttr} class='av-magazine-thumbnail-link '>{$image}</a>";
         }
         if (!$image) {
             $output .= $icon;
         }
         $output .= "</div>";
     }
     $output .= "<div class='av-magazine-content-wrap'>";
     $output .= "<header class='entry-content-header'>";
     $output .= "<time class='av-magazine-time updated' {$markupTime}>" . $time . "</time>";
     $output .= $separator . $author;
     $output .= "<{$titleTag} class='av-magazine-title entry-title' {$markupTitle}>{$title}</{$titleTag}>";
     $output .= "</header>";
     if ($excerpt) {
         $output .= "<div class='av-magazine-content entry-content' {$markupContent}>{$excerpt}</div>";
     }
     $output .= "</div>";
     $output .= "<footer class='entry-footer'></footer>";
     $output .= "</article>";
     return $output;
 }
Ejemplo n.º 8
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $class = "";
     $alt = "";
     $title = "";
     $src = "";
     $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $hotspots = ShortcodeHelper::shortcode2array($content, 1);
     extract(shortcode_atts(array('animation' => 'no-animation', 'attachment' => '', 'attachment_size' => '', 'hotspot_layout' => 'numbered', 'hotspot_mobile' => '', 'hotspot_tooltip_display' => ''), $atts, $this->config['shortcode']));
     if (!empty($attachment)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : "";
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     }
     //no src? return
     if (!empty($src)) {
         if (!ShortcodeHelper::is_top_level()) {
             $meta['el_class'] .= " av-non-fullwidth-hotspot-image";
         }
         $hotspot_html = "";
         $tooltip_html = "";
         $counter = 1;
         foreach ($hotspots as $hotspot) {
             if (!empty($hotspot_mobile)) {
                 $tooltip_html .= $this->add_fallback_tooltip($hotspot, $counter);
             }
             $extraClass = !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
             $extraClass .= !empty($hotspot_tooltip_display) ? " {$hotspot_tooltip_display}-single " : "";
             $hotspot_html .= $this->add_hotspot($hotspot, $counter, $extraClass);
             $counter++;
         }
         //some custom classes
         $class .= $animation == "no-animation" ? "" : " avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-hotspot-" . $hotspot_layout;
         $class .= !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
         $class .= " " . $hotspot_tooltip_display;
         $output .= "<div class='av-hotspot-image-container avia_animate_when_almost_visible {$class} " . $meta['el_class'] . " ' {$markup} >";
         $output .= "<div class='av-hotspot-container'>";
         $output .= "<div class='av-hotspot-container-inner-cell'>";
         $output .= "<div class='av-hotspot-container-inner-wrap'>";
         $output .= $hotspot_html;
         $output .= "<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
         $output .= "</div>";
         $output .= "</div>";
         $output .= "</div>";
         $output .= $tooltip_html;
         $output .= "</div>";
     }
     if (!ShortcodeHelper::is_top_level()) {
         return $output;
     }
     $skipSecond = false;
     $params['class'] = "main_color av-fullwidth-hotspots " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     $image = $output;
     $output = avia_new_section($params);
     $output .= $image;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_image_hotspots"));
     }
     return $output;
 }
Ejemplo n.º 9
0
/**
 * Sidebar left open functions.
 *
 * @since 1.0.0
 * @package GeoDirectory
 * @param string $type Page type.
 * @param string $id The id of the HTML element.
 * @param string $class The class of the HTML element.
 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
 */
function enfold_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
{
    $sidebar_smartphone = avia_get_option('smartphones_sidebar') == 'smartphones_sidebar' ? 'smartphones_sidebar_active' : "";
    echo "<aside class='sidebar sidebar_left " . $sidebar_smartphone . " " . avia_layout_class('sidebar', false) . " units' " . avia_markup_helper(array('context' => 'sidebar', 'echo' => false)) . ">";
    echo "<div class='inner_sidebar extralight-border'>";
}
Ejemplo n.º 10
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     global $avia_config;
     if (empty($atts['categories'])) {
         $atts['categories'] = "";
     }
     if (isset($atts['link']) && isset($atts['blog_type']) && $atts['blog_type'] == 'taxonomy') {
         $atts['link'] = explode(',', $atts['link'], 2);
         $atts['taxonomy'] = $atts['link'][0];
         if (!empty($atts['link'][1])) {
             $atts['categories'] = $atts['link'][1];
         } else {
             if (!empty($atts['taxonomy'])) {
                 $taxonomy_terms_obj = get_terms($atts['taxonomy']);
                 foreach ($taxonomy_terms_obj as $taxonomy_term) {
                     $atts['categories'] .= $taxonomy_term->term_id . ',';
                 }
             }
         }
     }
     $atts = shortcode_atts(array('blog_style' => '', 'columns' => 3, 'blog_type' => 'posts', 'items' => '16', 'paginate' => 'yes', 'categories' => '', 'preview_mode' => 'auto', 'image_size' => 'portfolio', 'taxonomy' => 'category', 'post_type' => get_post_types(), 'contents' => 'excerpt', 'content_length' => 'content', 'offset' => '0'), $atts);
     if ($atts['blog_style'] == "blog-grid") {
         $atts['class'] = $meta['el_class'];
         $atts['type'] = 'grid';
         //using the post slider with inactive js will result in displaying a nice post grid
         $slider = new avia_post_slider($atts);
         $slider->query_entries();
         return $slider->html();
     }
     $this->query_entries($atts);
     $avia_config['blog_style'] = $atts['blog_style'];
     $avia_config['preview_mode'] = $atts['preview_mode'];
     $avia_config['image_size'] = $atts['image_size'];
     $avia_config['blog_content'] = $atts['content_length'];
     $avia_config['remove_pagination'] = $atts['paginate'] === "yes" ? false : true;
     $more = 0;
     ob_start();
     //start buffering the output instead of echoing it
     get_template_part('includes/loop', 'index');
     $output = ob_get_clean();
     wp_reset_query();
     avia_set_layout_array();
     if ($output) {
         $markup = avia_markup_helper(array('context' => 'blog', 'echo' => false));
         $output = "<div class='template-blog' {$markup}>{$output}</div>";
     }
     return $output;
 }
Ejemplo n.º 11
0
function avia_woocommerce_before_shop_loop()
{
    global $avia_config;
    if (isset($avia_config['dynamic_template'])) {
        return;
    }
    $markup = avia_markup_helper(array('context' => 'content', 'echo' => false, 'post_type' => 'products'));
    echo "<main class='template-shop content " . avia_layout_class('content', false) . " units' {$markup}><div class='entry-content-wrapper'>";
}
Ejemplo n.º 12
0
 function av_tab($atts, $content = "", $shortcodename = "")
 {
     $output = $titleClass = $contentClass = $icon = "";
     $tab_atts = shortcode_atts(array('title' => '', 'icon_select' => 'no', 'icon' => "", 'custom_id' => '', 'font' => '', 'custom_markup' => ''), $atts, 'av_tab');
     $display_char = av_icon($tab_atts['icon'], $tab_atts['font']);
     if (is_numeric(avia_sc_tab::$initial) && avia_sc_tab::$counter == avia_sc_tab::$initial) {
         $titleClass = "active_tab";
         $contentClass = "active_tab_content";
     }
     if (empty($tab_atts['title'])) {
         $tab_atts['title'] = avia_sc_toggle::$counter;
     }
     if ($tab_atts['icon_select'] == "yes") {
         $icon = "<span class='tab_icon' {$display_char}></span>";
     }
     if (empty($tab_atts['custom_id'])) {
         $tab_atts['custom_id'] = 'tab-id-' . avia_sc_tab::$tab_id++;
     }
     $markup_tab = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $tab_atts['custom_markup']));
     $markup_title = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'custom_markup' => $tab_atts['custom_markup']));
     $markup_text = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $tab_atts['custom_markup']));
     $output .= '<section class="av_tab_section" ' . $markup_tab . '>';
     $output .= '    <div data-fake-id="#' . $tab_atts['custom_id'] . '" class="tab ' . $titleClass . '" ' . $markup_title . '>' . $icon . $tab_atts['title'] . '</div>' . "\n";
     $output .= '    <div id="' . $tab_atts['custom_id'] . '-container" class="tab_content ' . $contentClass . '">' . "\n";
     $output .= '        <div class="tab_inner_content invers-color" ' . $markup_text . '>' . "\n";
     $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "\n";
     $output .= '        </div>' . "\n";
     $output .= '    </div>' . "\n";
     $output .= '</section>' . "\n";
     avia_sc_tab::$counter++;
     return $output;
 }
Ejemplo n.º 13
0
/* Always have wp_head() just before the closing </head>
 * tag of your theme, or you will break many plugins, which
 * generally use this hook to add elements to <head> such
 * as styles, scripts, and meta tags.
 */
wp_head();
?>

</head>




<body id="top" <?php 
body_class($style . " " . $avia_config['font_stack'] . " " . $blank);
avia_markup_helper(array('context' => 'body'));
?>
>

	<div id='wrap_all'>

	<?php 
if (!$blank) {
    //fetch the template file that holds the main menu, located in includes/helper-menu-main.php
    get_template_part('includes/helper', 'main-menu');
}
?>
	
	<div id='main' data-scroll-offset='<?php 
echo avia_header_setting('header_scroll_offset');
?>
Ejemplo n.º 14
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $class = "";
     $alt = "";
     $title = "";
     $atts = shortcode_atts(array('src' => '', 'animation' => 'no-animation', 'link' => '', 'attachment' => '', 'attachment_size' => '', 'target' => 'no', 'styling' => '', 'caption' => '', 'font_size' => '', 'appearance' => '', 'hover' => '', 'align' => 'center', 'overlay_opacity' => '0.4', 'overlay_color' => '#444444', 'overlay_text_color' => '#ffffff'), $atts, $this->config['shortcode']);
     extract($atts);
     if (!empty($attachment)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : "";
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     } else {
         $attachment = false;
     }
     if (!empty($src)) {
         $class = $animation == "no-animation" ? "" : "avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-styling-" . $styling . " " . $hover;
         if (is_numeric($src)) {
             //$output = wp_get_attachment_image($src,'large');
             $output = wp_get_attachment_image($src, 'large', false, array('class' => "avia_image {$class} " . $this->class_by_arguments('align', $atts, true)));
         } else {
             $link = aviaHelper::get_url($link, $attachment);
             $blank = strpos($target, '_blank') !== false || $target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
             $overlay = "";
             $style = "";
             $style .= AviaHelper::style_string($atts, 'overlay_text_color', 'color');
             if ($font_size) {
                 // $style = "style='font-size: {$font_size}px;'";
                 $style .= AviaHelper::style_string($atts, 'font_size', 'font-size', 'px');
             }
             $style = AviaHelper::style_string($style);
             if ($caption == "yes") {
                 $caption_style = "";
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_opacity', 'opacity');
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_color', 'background-color');
                 $caption_style = AviaHelper::style_string($caption_style);
                 $overlay_bg = "<div class='av-caption-image-overlay-bg' {$caption_style}></div>";
                 $content = ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
                 $overlay = "<div class='av-image-caption-overlay'>{$overlay_bg}<div class='av-image-caption-overlay-position'><div class='av-image-caption-overlay-center' {$style}>{$content}</div></div></div>";
                 $class .= " noHover ";
                 if (empty($appearance)) {
                     $appearance = "hover-deactivate";
                 }
                 if ($appearance) {
                     $class .= " av-overlay-" . $appearance;
                 }
             }
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $output .= "<div class='avia-image-container {$class} " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . "' {$markup} >";
             $output .= "<div class='avia-image-container-inner'>";
             if ($link) {
                 $output .= "<a href='{$link}' class='avia_image'  {$blank}>{$overlay}<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}' {$markup_url} /></a>";
             } else {
                 $output .= "{$overlay}<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
             }
             $output .= "</div>";
             $output .= "</div>";
         }
     }
     return $output;
 }
Ejemplo n.º 15
0
 function filter_quote($entry)
 {
     $output = "";
     $output .= "<blockquote class='first-quote' " . avia_markup_helper(array('context' => 'entry_title', 'echo' => false)) . ">";
     $output .= get_the_title($entry->ID);
     $output .= "</blockquote>";
     $entry->av_title = $output;
 }
Ejemplo n.º 16
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     extract(shortcode_atts(array('title' => 'Title', 'icon' => 'ue800', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'linkelement' => '', 'font' => '', 'boxed' => '', 'color' => '', 'custom_bg' => '', 'custom_border' => '', 'custom_font' => '', 'font_color' => "", 'custom_title' => '', 'custom_content' => ''), $atts, $this->config['shortcode']));
     $display_char = av_icon($icon, $font);
     $display_char_wrapper = array();
     if ($position == 'top' && empty($boxed)) {
         $position .= " main_color";
     }
     if ($position != 'top') {
         $boxed = "";
     }
     $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : "";
     $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $link = aviaHelper::get_url($link);
     if (!empty($link)) {
         $linktitle = $title;
         switch ($linkelement) {
             case 'both':
                 $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}>{$linktitle}</a>";
                 $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}";
                 $display_char_wrapper['end'] = 'a';
                 break;
             case 'only_icon':
                 $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}";
                 $display_char_wrapper['end'] = 'a';
                 break;
             default:
                 $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank} >{$linktitle}</a>";
                 $display_char_wrapper['start'] = 'div';
                 $display_char_wrapper['end'] = 'div';
                 break;
         }
     }
     if (empty($display_char_wrapper)) {
         $display_char_wrapper['start'] = 'div';
         $display_char_wrapper['end'] = 'div';
     }
     $icon_html_styling = "";
     $title_styling = "";
     $content_styling = "";
     $content_class = "";
     if ($color == "custom") {
         $icon_html_styling .= !empty($custom_bg) ? "background-color:{$custom_bg}; " : "";
         $icon_html_styling .= !empty($custom_border) ? "border:1px solid {$custom_border}; " : "";
         $icon_html_styling .= !empty($custom_font) ? "color:{$custom_font}; " : "";
         if ($icon_html_styling) {
             $icon_html_styling = " style='{$icon_html_styling}'";
         }
     }
     if ($font_color == "custom") {
         $title_styling .= !empty($custom_title) ? "color:{$custom_title}; " : "";
         $content_styling .= !empty($custom_content) ? "color:{$custom_content}; " : "";
         if ($title_styling) {
             $title_styling = " style='{$title_styling}'";
         }
         if ($content_styling) {
             $content_styling = " style='{$content_styling}'";
             $content_class = "av_inherit_color";
         }
     }
     $icon_html = '<' . $display_char_wrapper['start'] . ' class="iconbox_icon heading-color" ' . $display_char . ' ' . $icon_html_styling . ' ></' . $display_char_wrapper['end'] . '>';
     // add blockquotes to the content
     $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $output = '<article class="iconbox iconbox_' . $position . ' ' . $boxed . ' ' . $meta['el_class'] . '" ' . $markup . '>';
     if ($position == 'left_content' || $position == 'right_content') {
         $output .= $icon_html;
         $icon_html = "";
     }
     $output .= '<div class="iconbox_content">';
     $output .= '<header class="entry-content-header">';
     $output .= $icon_html;
     $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $output .= "<h3 class='iconbox_content_title' {$markup} {$title_styling}>" . $title . "</h3>";
     $output .= '</header>';
     $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $output .= "<div class='iconbox_content_container {$content_class}' {$markup} {$content_styling}>";
     $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
     $output .= '</div>';
     $output .= '</div>';
     $output .= '<footer class="entry-footer"></footer>';
     $output .= '</article>';
     return $output;
 }
Ejemplo n.º 17
0
 protected function build_preview_template($entry)
 {
     if (isset(avia_post_grid::$preview_template[$entry->ID])) {
         return;
     }
     avia_post_grid::$preview_template[$entry->ID] = true;
     $id = $entry->ID;
     $output = "";
     $defaults = array('ids' => get_post_thumbnail_id($id), 'text' => apply_filters('get_the_excerpt', $entry->post_excerpt), "method" => 'gallery', "auto" => "", "columns" => 5);
     $params['ids'] = get_post_meta($id, '_preview_ids', true);
     $params['text'] = get_post_meta($id, '_preview_text', true);
     $params['method'] = get_post_meta($id, '_preview_display', true);
     $params['interval'] = get_post_meta($id, '_preview_autorotation', true);
     $params['columns'] = get_post_meta($id, '_preview_columns', true);
     $params['preview_size'] = apply_filters('avf_ajax_preview_image_size', "gallery");
     $params['autoplay'] = is_numeric($params['interval']) ? "true" : "false";
     $link = get_post_meta($id, '_portfolio_custom_link', true) != "" ? get_post_meta($id, '_portfolio_custom_link_url', true) : get_permalink($id);
     //merge default and params array. remove empty params with array_filter
     $params = array_merge($defaults, array_filter($params));
     $params = apply_filters('avf_portfolio_preview_template_params', $params, $entry);
     //set the content
     $content = str_replace(']]>', ']]&gt;', apply_filters('the_content', $params['text']));
     unset($params['text']);
     //set images
     $string = "";
     //set first class if preview images are deactivated
     $nogalleryclass = '';
     $params['ajax_request'] = true;
     switch ($params['method']) {
         case 'gallery':
             $params['style'] = "big_thumb";
             foreach ($params as $key => $param) {
                 $string .= $key . "='" . $param . "' ";
             }
             $images = do_shortcode("[av_gallery {$string}]");
             break;
         case 'slideshow':
             $params['size'] = $params['preview_size'];
             foreach ($params as $key => $param) {
                 $string .= $key . "='" . $param . "' ";
             }
             $images = do_shortcode("[av_slideshow {$string}]");
             break;
         case 'list':
             $images = $this->post_images($params['ids']);
             break;
         case 'no':
             $images = false;
             $nogalleryclass = ' no_portfolio_preview_gallery ';
             break;
     }
     $output .= "<div class='ajax_slide ajax_slide_{$id}' data-slide-id='{$id}' >";
     $output .= "<article class='inner_slide {$nogalleryclass}' " . avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $id, 'custom_markup' => $this->atts['custom_markup'])) . ">";
     if (!empty($images)) {
         $output .= "<div class='av_table_col first portfolio-preview-image'>";
         $output .= $images;
         $output .= "</div>";
     }
     if (!empty($nogalleryclass)) {
         $nogalleryclass .= ' first ';
     }
     $output .= "<div class='av_table_col {$nogalleryclass} portfolio-entry portfolio-preview-content'>";
     $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $id, 'custom_markup' => $this->atts['custom_markup']));
     $output .= '<header class="entry-content-header">';
     $output .= "<h2 class='portfolio-preview-title entry-title' {$markup}><a href='{$link}'>" . $entry->post_title . "</a></h2>";
     $output .= '</header>';
     $output .= "<div class='entry-content-wrapper entry-content' " . avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $id, 'custom_markup' => $this->atts['custom_markup'])) . ">";
     $output .= $content;
     $output .= "</div>";
     $output .= "<span class='avia-arrow'></span>";
     $output .= "</div>";
     $output .= '<footer class="entry-footer"></footer>';
     $output .= "</article>";
     $output .= "</div>";
     return "<script type='text/html' id='avia-tmpl-portfolio-preview-{$id}'>\n{$output}\n</script>\n\n";
 }
 function avia_quote_content_filter($current_post)
 {
     if (!empty($current_post['title'])) {
         //$current_post['title'] 		= "<div class='". avia_offset_class('meta', false). "'><blockquote class='first-quote'>".$current_post['title']."</blockquote></div>";
         $current_post['title'] = "<blockquote class='first-quote' " . avia_markup_helper(array('context' => 'entry_title', 'echo' => false)) . ">" . $current_post['title'] . "</blockquote>";
     }
     return $current_post;
 }
Ejemplo n.º 19
0
?>



		<div class='container_wrap container_wrap_first main_color <?php 
avia_layout_class('main');
?>
'>

			<div class='container'>

				<main class='template-archives content <?php 
avia_layout_class('content');
?>
 units' <?php 
avia_markup_helper(array('context' => 'content'));
?>
>

                    <div class="entry-content-wrapper entry-content clearfix">

                    <?php 
//display the actual post content
the_post();
the_content();
/*
 * Display the latest 20 blog posts
 */
query_posts(array('posts_per_page' => 20));
// check if we got posts to display:
echo '<div class="tabcontainer top_tab">' . "\n";
Ejemplo n.º 20
0
function avia_new_section($params = array())
{
    global $avia_section_markup, $avia_config;
    $defaults = array('class' => 'main_color', 'bg' => '', 'close' => true, 'open' => true, 'open_structure' => true, 'open_color_wrap' => true, 'data' => '', "style" => '', 'id' => "", 'main_container' => false, 'min_height' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'attach' => "", 'custom_markup' => '');
    $defaults = array_merge($defaults, $params);
    extract($defaults);
    $post_class = "";
    $output = "";
    $bg_slider = "";
    if ($id) {
        $id = "id='{$id}'";
    }
    //close old content structure. only necessary when previous element was a section. other fullwidth elements dont need this
    if ($close) {
        $cm = avia_section_close_markup();
        $output .= "</div></div>{$cm}</div></div>";
    }
    //start new
    if ($open) {
        if (function_exists('avia_get_the_id')) {
            $post_class = "post-entry-" . avia_get_the_id();
        }
        if ($open_color_wrap) {
            if (!empty($min_height)) {
                $class .= " av-minimum-height av-minimum-height-" . $min_height;
            }
            if (!empty($video)) {
                $slide = array('shortcode' => 'av_slideshow', 'content' => '', 'attr' => array('id' => '', 'video' => $video, 'slide_type' => 'video', 'video_mute' => true, 'video_loop' => true, 'video_ratio' => $video_ratio, 'video_controls' => 'disabled', 'video_section_bg' => true, 'video_format' => '', 'video_mobile' => '', 'video_mobile_disabled' => $video_mobile_disabled));
                $bg_slider = new avia_slideshow(array('content' => array($slide)));
                $bg_slider->set_extra_class('av-section-video-bg');
                $class .= " av-section-with-video-bg";
                $class .= !empty($video_mobile_disabled) ? " av-section-mobile-video-disabled" : "";
                $data .= "  data-section-video-ratio='{$video_ratio}'";
            }
            $output .= "<div {$id} class='{$class} container_wrap " . avia_layout_class('main', false) . "' {$bg} {$data} {$style}>";
            $output .= !empty($bg_slider) ? $bg_slider->html() : "";
            $output .= $attach;
            $output .= apply_filters('avf_section_container_add', '', $defaults);
        }
        //this applies only for sections. other fullwidth elements dont need the container for centering
        if ($open_structure) {
            if (!empty($main_container)) {
                $markup = 'main ' . avia_markup_helper(array('context' => 'content', 'echo' => false, 'custom_markup' => $custom_markup));
                $avia_section_markup = 'main';
            } else {
                $markup = "div";
            }
            $output .= "<div class='container'>";
            $output .= "<{$markup} class='template-page content  " . avia_layout_class('content', false) . " units'>";
            $output .= "<div class='post-entry post-entry-type-page {$post_class}'>";
            $output .= "<div class='entry-content-wrapper clearfix'>";
        }
    }
    return $output;
}
Ejemplo n.º 21
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('name' => '', 'src' => '', 'description' => '', 'job' => '', 'custom_markup' => '', 'font_color' => '', 'custom_title' => '', 'custom_content' => ''), $atts, $this->config['shortcode']);
     extract($atts);
     $title_styling = "";
     $content_styling = "";
     $content_class = "";
     $title_class = "";
     if ($font_color == "custom") {
         $title_styling .= !empty($custom_title) ? "color:{$custom_title}; " : "";
         $content_styling .= !empty($custom_content) ? "color:{$custom_content}; " : "";
         if ($title_styling) {
             $title_styling = " style='{$title_styling}'";
             $title_class = "av_opacity_variation";
         }
         if ($content_styling) {
             $content_styling = " style='{$content_styling}'";
             $content_class = "av_inherit_color";
         }
     }
     $socials = ShortcodeHelper::shortcode2array($content);
     $output = "";
     $markup = avia_markup_helper(array('context' => 'person', 'echo' => false, 'custom_markup' => $custom_markup));
     $output .= "<section class='avia-team-member " . $meta['el_class'] . "' {$markup}>";
     if ($src) {
         $output .= "<div class='team-img-container'>";
         $markup = avia_markup_helper(array('context' => 'single_image', 'echo' => false, 'custom_markup' => $custom_markup));
         $output .= "<img class='avia_image avia_image_team' src='" . $src . "' alt='" . esc_attr($name) . "' {$markup} />";
         if (!empty($socials)) {
             $output .= "<div class='team-social'>";
             $output .= "<div class='team-social-inner'>";
             foreach ($socials as $social) {
                 //set defaults
                 $social['attr'] = shortcode_atts(array('link' => '', 'link_target' => '', 'icon' => '', 'font' => '', 'title' => ''), $social['attr'], 'av_social');
                 //build link for each social item
                 $tooltip = $social['attr']['title'] ? 'data-avia-tooltip="' . $social['attr']['title'] . '"' : "";
                 $target = $social['attr']['link_target'] ? "target='_blank'" : "";
                 //apply special class in case its a link to a known social media service
                 $social_class = $this->get_social_class($social['attr']['link']);
                 if (strstr($social['attr']['link'], '@')) {
                     $markup = avia_markup_helper(array('context' => 'email', 'echo' => false, 'custom_markup' => $custom_markup));
                 } else {
                     $markup = avia_markup_helper(array('context' => 'url', 'echo' => false, 'custom_markup' => $custom_markup));
                 }
                 $display_char = av_icon($social['attr']['icon'], $social['attr']['font']);
                 $output .= "<span class='hidden av_member_url_markup {$social_class}' {$markup}>" . $social['attr']['link'] . "</span>";
                 $output .= "<a rel='v:url' {$tooltip} {$target} class='{$social_class} avia-team-icon ' href='" . $social['attr']['link'] . "' {$display_char}>";
                 $output .= "</a>";
             }
             $output .= "</div>";
             $output .= "</div>";
         }
         $output .= "</div>";
     }
     if ($name) {
         $markup = avia_markup_helper(array('context' => 'name', 'echo' => false, 'custom_markup' => $custom_markup));
         $output .= "<h3 class='team-member-name' {$title_styling} {$markup}>{$name}</h3>";
     }
     if ($job) {
         $markup = avia_markup_helper(array('context' => 'job', 'echo' => false, 'custom_markup' => $custom_markup));
         $output .= "<div class='team-member-job-title {$title_class}' {$title_styling} {$markup}>{$job}</div>";
     }
     if ($description) {
         $markup = avia_markup_helper(array('context' => 'description', 'echo' => false, 'custom_markup' => $custom_markup));
         $output .= "<div class='team-member-description {$content_class}' {$markup} {$content_styling}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($description)) . "</div>";
     }
     $markup = avia_markup_helper(array('context' => 'affiliation', 'echo' => false, 'custom_markup' => $custom_markup));
     $output .= "<span class='hidden team-member-affiliation' {$markup}>" . get_bloginfo('name') . "</span>";
     $output .= "</section>";
     return $output;
 }
Ejemplo n.º 22
0
 protected function advanced_slide()
 {
     $html = "";
     $counter = 0;
     $this->ie8_fallback = "";
     foreach ($this->id_array as $key => $id) {
         $meta = array_merge(array('content' => $this->subslides[$key]['content'], 'title' => '', 'link_apply' => '', 'link' => '', 'link_target' => '', 'button_label' => '', 'button_color' => 'light', 'link1' => '', 'link_target1' => '', 'button_label2' => '', 'button_color2' => 'light', 'link2' => '', 'link_target2' => '', 'position' => 'center center', 'caption_pos' => 'capt-bottom capt-left', 'video_cover' => '', 'video_controls' => '', 'video_mute' => '', 'video_loop' => '', 'video_format' => '', 'video_autoplay' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'video_mobile' => 'mobile-fallback-image', 'mobile_image' => '', 'slide_type' => '', 'custom_markup' => ''), $this->subslides[$key]['attr']);
         extract($meta);
         if (isset($this->slides[$id]) || $slide_type == 'video') {
             $img = array('');
             $slide = "";
             $attachment_id = isset($this->slides[$id]) ? $id : false;
             $link = AviaHelper::get_url($link, $attachment_id);
             $extra_class = "";
             $linkdescription = "";
             $linkalt = "";
             $this->service = false;
             $slider_data = "";
             $stretch_height = false;
             $final_ratio = "";
             $viewport = 16 / 9;
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'id' => $attachment_id, 'custom_markup' => $custom_markup));
             if ($slide_type == 'video') {
                 $this->service = avia_slideshow_video_helper::which_video_service($video);
                 $video = avia_slideshow_video_helper::set_video_slide($video, $this->service, $meta);
                 $video_class = !empty($video_controls) ? " av-hide-video-controls" : "";
                 $video_class .= !empty($video_mute) ? " av-mute-video" : "";
                 $video_class .= !empty($video_loop) ? " av-loop-video" : "";
                 $video_class .= !empty($video_mobile) ? " av-" . $video_mobile : "";
                 $extra_class .= " av-video-slide " . $video_cover . " av-video-service-" . $this->service . " " . $video_class;
                 $slider_data .= " data-controls='{$video_controls}' data-mute='{$video_mute}' data-loop='{$video_loop}' data-disable-autoplay='{$video_autoplay}' ";
                 if ($mobile_image) {
                     $fallback_img = wp_get_attachment_image_src($mobile_image, $this->config['size']);
                     $slider_data .= " data-mobile-img='" . $fallback_img[0] . "'";
                 }
                 //if we dont use a fullscreen slider pass the video ratio to the slider
                 if ($this->config['bg_slider'] != "true") {
                     global $avia_config;
                     //if we use the small slideshow only allow the "full" $video_format
                     if ($this->config['handle'] == 'av_slideshow') {
                         $video_format = "full";
                     }
                     //calculate the viewport ratio
                     if (!empty($avia_config['imgSize'][$this->config['size']])) {
                         $viewport = $avia_config['imgSize'][$this->config['size']]['width'] / $avia_config['imgSize'][$this->config['size']]['height'];
                     }
                     //calculate the ratio when passed as a string (eg: 16:9, 4:3). fallback is 16:9
                     $video_ratio = explode(':', trim($video_ratio));
                     if (empty($video_ratio[0])) {
                         $video_ratio[0] = 16;
                     }
                     if (empty($video_ratio[1])) {
                         $video_ratio[1] = 9;
                     }
                     $final_ratio = (int) $video_ratio[0] / (int) $video_ratio[1];
                     switch ($video_format) {
                         case "":
                             $final_ratio = $viewport;
                             break;
                         case "stretch":
                             $final_ratio = $viewport;
                             $stretch_height = ceil($viewport / ($video_ratio[0] / $video_ratio[1]) * 100);
                             $stretch_pos = ($stretch_height - 100) / 2 * -1;
                             $slider_data .= " data-video-height='{$stretch_height}'";
                             $slider_data .= " data-video-toppos='{$stretch_pos}'";
                             $extra_class .= " av-video-stretch";
                             break;
                         case "full":
                             // do nothing and apply the entered ratio
                             break;
                     }
                     $slider_data .= " data-video-ratio='{$final_ratio}'";
                 }
             } else {
                 $slide = $this->slides[$id];
                 $linktitle = trim($slide->post_title) ? esc_attr($slide->post_title) : "";
                 if ($linktitle == "-") {
                     $linktitle = "";
                 }
                 $linkdescription = trim($slide->post_content) && empty($link) ? "title='" . esc_attr($slide->post_content) . "'" : "";
                 $linkalt = get_post_meta($slide->ID, '_wp_attachment_image_alt', true);
                 $linkalt = !empty($linkalt) ? esc_attr($linkalt) : '';
                 $img = wp_get_attachment_image_src($slide->ID, $this->config['size']);
                 $video = "";
             }
             if ($this->slide_count === 1) {
                 $extra_class .= " av-single-slide";
             }
             $blank = strpos($link_target, '_blank') !== false || $link_target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($link_target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
             $tags = !empty($link) && $link_apply == 'image' ? array("a href='{$link}'{$blank}", 'a') : array('div', 'div');
             $caption = "";
             $button_html = "";
             $counter++;
             $button_count = "";
             if (strpos($link_apply, 'button-two') !== false) {
                 $button_count = "avia-multi-slideshow-button";
             }
             //if we got a CTA button apply the link to the button istead of the slide
             if (strpos($link_apply, 'button') !== false) {
                 $button_html .= $this->slideshow_cta_button($link1, $link_target1, $button_color, $button_label, $button_count);
                 $tags = array('div', 'div');
             }
             if (strpos($link_apply, 'button-two') !== false) {
                 $button_count .= " avia-slideshow-button-2";
                 $button_html .= $this->slideshow_cta_button($link2, $link_target2, $button_color2, $button_label2, $button_count);
             }
             //check if we got a caption
             $markup_description = avia_markup_helper(array('context' => 'description', 'echo' => false, 'id' => $attachment_id, 'custom_markup' => $custom_markup));
             $markup_name = avia_markup_helper(array('context' => 'name', 'echo' => false, 'id' => $attachment_id, 'custom_markup' => $custom_markup));
             if (trim($title) != "") {
                 $title = "<h2 class='avia-caption-title' {$markup_name}>" . trim(apply_filters('avf_slideshow_title', $title)) . "</h2>";
             }
             if (is_array($content)) {
                 $content = implode(' ', $content);
             }
             //temp fix for trim() expects string warning until I can actually reproduce the problem
             if (trim($content) != "") {
                 $content = "<div class='avia-caption-content' {$markup_description}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop(trim($content))) . "</div>";
             }
             if (trim($title . $content . $button_html) != "") {
                 if (trim($title) != "" && trim($button_html) != "" && trim($content) == "") {
                     $content = "<br/>";
                 }
                 if ($this->config['handle'] == 'av_slideshow_full' || $this->config['handle'] == 'av_fullscreen') {
                     $caption .= '<div class = "caption_fullwidth ' . $caption_pos . '">';
                     $caption .= '<div class = "container caption_container">';
                     $caption .= '<div class = "slideshow_caption">';
                     $caption .= '<div class = "slideshow_inner_caption">';
                     $caption .= '<div class = "slideshow_align_caption">';
                     $caption .= $title;
                     $caption .= $content;
                     $caption .= $button_html;
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                 } else {
                     $caption = '<div class="avia-caption"><div class="avia-inner-caption">' . $title . $content . "</div></div>";
                 }
             }
             if (!empty($img[0])) {
                 $slider_data .= $this->config['bg_slider'] == "true" ? "style='background-position:{$position};' data-img-url='" . $img[0] . "'" : "";
                 if ($slider_data) {
                     if (empty($this->ie8_fallback)) {
                         $this->ie8_fallback .= "<!--[if lte IE 8]>";
                         $this->ie8_fallback .= "<style type='text/css'>";
                     }
                     $this->ie8_fallback .= "\n #{$this->config['css_id']} .slide-{$counter}{";
                     $this->ie8_fallback .= "\n -ms-filter: \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$img[0]}', sizingMethod='scale')\"; ";
                     $this->ie8_fallback .= "\n filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$img[0]}', sizingMethod='scale'); ";
                     $this->ie8_fallback .= "\n } \n";
                 }
             }
             $html .= "<li {$slider_data} class='{$extra_class} slide-{$counter} ' >";
             $html .= "<" . $tags[0] . " data-rel='slideshow-" . avia_slideshow::$slider . "' class='avia-slide-wrap' {$linkdescription} >{$caption}";
             if ($this->config['bg_slider'] != "true" && empty($video)) {
                 $html .= "<img src='" . $img[0] . "' width='" . $img[1] . "' height='" . $img[2] . "' title='" . $linktitle . "' alt='" . $linkalt . "' {$markup_url} />";
             }
             $html .= $video;
             $html .= "</" . $tags[1] . ">";
             $html .= "</li>";
         } else {
             $this->slide_count--;
         }
     }
     if (!empty($this->ie8_fallback)) {
         $this->ie8_fallback .= "</style> <![endif]-->";
         add_action('wp_footer', array($this, 'add_ie8_fallback_to_footer'));
     }
     return $html;
 }
Ejemplo n.º 23
0
 function avia_title($args = false, $id = false)
 {
     global $avia_config;
     if (!$id) {
         $id = avia_get_the_id();
     }
     $header_settings = avia_header_setting();
     if ($header_settings['header_title_bar'] == 'hidden_title_bar') {
         return "";
     }
     $defaults = array('title' => get_the_title($id), 'subtitle' => "", 'link' => get_permalink($id), 'html' => "<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}>{additions}</div></div>", 'class' => 'stretch_full container_wrap alternate_color ' . avia_is_dark_bg('alternate_color', true), 'breadcrumb' => true, 'additions' => "", 'heading' => 'h1');
     if (is_tax() || is_category() || is_tag()) {
         global $wp_query;
         $term = $wp_query->get_queried_object();
         $defaults['link'] = get_term_link($term);
     } else {
         if (is_archive()) {
             $defaults['link'] = "";
         }
     }
     // Parse incomming $args into an array and merge it with $defaults
     $args = wp_parse_args($args, $defaults);
     $args = apply_filters('avf_title_args', $args, $id);
     //disable breadcrumb if requested
     if ($header_settings['header_title_bar'] == 'title_bar') {
         $args['breadcrumb'] = false;
     }
     //disable title if requested
     if ($header_settings['header_title_bar'] == 'breadcrumbs_only') {
         $args['title'] = '';
     }
     // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
     extract($args, EXTR_SKIP);
     if (empty($title)) {
         $class .= " empty_title ";
     }
     $markup = avia_markup_helper(array('context' => 'avia_title', 'echo' => false));
     if (!empty($link) && !empty($title)) {
         $title = "<a href='" . $link . "' rel='bookmark' title='" . __('Permanent Link:', 'avia_framework') . " " . esc_attr($title) . "' {$markup}>" . $title . "</a>";
     }
     if (!empty($subtitle)) {
         $additions .= "<div class='title_meta meta-color'>" . wpautop($subtitle) . "</div>";
     }
     if ($breadcrumb) {
         $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true));
     }
     $html = str_replace('{class}', $class, $html);
     $html = str_replace('{title}', $title, $html);
     $html = str_replace('{additions}', $additions, $html);
     $html = str_replace('{heading}', $heading, $html);
     if (!empty($avia_config['slide_output']) && !avia_is_dynamic_template($id) && !avia_is_overview()) {
         $avia_config['small_title'] = $title;
     } else {
         return $html;
     }
 }
Ejemplo n.º 24
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $first = true;
     extract(shortcode_atts(array('order' => 'ASC', 'thumb_size' => 'thumbnail', 'lightbox_size' => 'large', 'preview_size' => 'portfolio', 'ids' => '', 'ajax_request' => false, 'imagelink' => 'lightbox', 'style' => 'thumbnails', 'columns' => 5, 'lazyload' => 'avia_lazyload', 'crop_big_preview_thumbnail' => 'avia-gallery-big-crop-thumb'), $atts));
     $attachments = get_posts(array('include' => $ids, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => 'post__in'));
     if (!empty($attachments) && is_array($attachments)) {
         self::$gallery++;
         $thumb_width = round(100 / $columns, 4);
         $markup = avia_markup_helper(array('context' => 'image', 'echo' => false));
         $output .= "<div class='avia-gallery avia-gallery-" . self::$gallery . " " . $lazyload . " avia_animate_when_visible " . $meta['el_class'] . "' {$markup}>";
         $thumbs = "";
         $counter = 0;
         foreach ($attachments as $attachment) {
             $link = apply_filters('avf_avia_builder_gallery_image_link', wp_get_attachment_image_src($attachment->ID, $lightbox_size), $attachment, $atts, $meta);
             $custom_link_class = !empty($link['custom_link_class']) ? $link['custom_link_class'] : '';
             $class = $counter++ % $columns ? "class='{$imagelink} {$custom_link_class}'" : "class='first_thumb {$imagelink} {$custom_link_class}'";
             $img = wp_get_attachment_image_src($attachment->ID, $thumb_size);
             $prev = wp_get_attachment_image_src($attachment->ID, $preview_size);
             $caption = trim($attachment->post_excerpt) ? wptexturize($attachment->post_excerpt) : "";
             $tooltip = $caption ? "data-avia-tooltip='" . $caption . "'" : "";
             $alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = trim($attachment->post_title) ? esc_attr($attachment->post_title) : "";
             $description = trim($attachment->post_content) ? esc_attr($attachment->post_content) : esc_attr(trim($attachment->post_excerpt));
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false));
             if ($style == "big_thumb" && $first) {
                 $output .= "<a class='avia-gallery-big fakeLightbox {$imagelink} {$crop_big_preview_thumbnail} {$custom_link_class}' href='" . $link[0] . "'  data-onclick='1' title='" . $description . "' ><span class='avia-gallery-big-inner' {$markup_url}>";
                 $output .= "\t<img width='" . $prev[1] . "' height='" . $prev[2] . "' src='" . $prev[0] . "' title='" . $title . "' alt='" . $alt . "' />";
                 if ($caption) {
                     $output .= "\t<span class='avia-gallery-caption'>{$caption}</span>";
                 }
                 $output .= "</span></a>";
             }
             $thumbs .= " <a href='" . $link[0] . "' data-rel='gallery-" . self::$gallery . "' data-prev-img='" . $prev[0] . "' {$class} data-onclick='{$counter}' title='" . $description . "' {$markup_url}><img {$tooltip} src='" . $img[0] . "' width='" . $img[1] . "' height='" . $img[2] . "'  title='" . $title . "' alt='" . $alt . "' /></a>";
             $first = false;
         }
         $output .= "<div class='avia-gallery-thumb'>{$thumbs}</div>";
         $output .= "</div>";
         //generate thumb width based on columns
         $this->extra_style .= "<style type='text/css'>";
         $this->extra_style .= "#top #wrap_all .avia-gallery-" . self::$gallery . " .avia-gallery-thumb a{width:{$thumb_width}%;}";
         $this->extra_style .= "</style>";
         if (!empty($this->extra_style)) {
             if (!empty($atts['ajax_request'])) {
                 $output .= $this->extra_style;
                 $this->extra_style = "";
             } else {
                 add_action('wp_footer', array($this, 'print_extra_style'));
             }
         }
     }
     return $output;
 }
Ejemplo n.º 25
0
 public function html()
 {
     $output = "";
     $counter = 0;
     avia_partner_logo::$slider++;
     if ($this->slide_count == 0) {
         return $output;
     }
     extract($this->config);
     $extraClass = 'first';
     $grid = 'one_third';
     $slide_loop_count = 1;
     $loop_counter = 1;
     $total = $columns % 2 ? "odd" : "even";
     $heading = !empty($this->config['heading']) ? '<h3>' . $this->config['heading'] . '</h3>' : "&nbsp;";
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             break;
         case "5":
             $grid = 'av_one_fifth';
             break;
         case "6":
             $grid = 'av_one_sixth';
             break;
         case "7":
             $grid = 'av_one_seventh';
             break;
         case "8":
             $grid = 'av_one_eighth';
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation));
     $thumb_fallback = "";
     $output .= "<div {$data} class='avia-logo-element-container {$border} avia-logo-{$type} avia-content-slider avia-smallarrow-slider avia-content-{$type}-active noHover avia-content-slider" . avia_partner_logo::$slider . " avia-content-slider-{$total} {$class}' >";
     $heading_class = '';
     if ($navigation == 'no') {
         $heading_class .= ' no-logo-slider-navigation ';
     }
     if ($heading == '&nbsp;') {
         $heading_class .= ' no-logo-slider-heading ';
     }
     $output .= "<div class='avia-smallarrow-slider-heading {$heading_class}'>";
     if ($heading != '&nbsp;' || $navigation != 'no') {
         $output .= "<div class='new-special-heading'>" . $heading . "</div>";
     }
     if (count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') {
         if ($navigation == 'arrows') {
             $output .= $this->slide_navigation_arrows();
         }
     }
     $output .= "</div>";
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $custom_markup));
     $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $custom_markup));
     $output .= "<div class='avia-content-slider-inner'>";
     foreach ($this->id_array as $key => $id) {
         if (isset($this->slides[$id])) {
             $slide = $this->slides[$id];
             $meta = array_merge(array('link' => '', 'link_target' => '', 'linktitle' => '', 'hover' => '', 'custom_markup' => ''), $this->subslides[$key]['attr']);
             extract($meta);
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'id' => $slide->ID, 'custom_markup' => $custom_markup));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'id' => $slide->ID, 'custom_markup' => $custom_markup));
             $img = wp_get_attachment_image($slide->ID, $size);
             $link = aviaHelper::get_url($link, $slide->ID);
             $blank = strpos($link_target, '_blank') !== false || $link_target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($link_target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
         }
         $parity = $loop_counter % 2 ? 'odd' : 'even';
         $last = $this->slide_count == $slide_loop_count ? " post-entry-last " : "";
         $post_class = "post-entry slide-entry-overview slide-loop-{$slide_loop_count} slide-parity-{$parity} {$last}";
         $thumb_class = "real-thumbnail";
         $single_data = empty($hover) ? '' : 'data-avia-tooltip="' . $hover . '"';
         if ($loop_counter == 1) {
             $output .= "<div class='slide-entry-wrap' {$markup}>";
         }
         $img = str_replace('<img ', "<img {$markup_url} ", $img);
         $output .= "<div {$single_data} class='slide-entry flex_column no_margin {$post_class} {$grid} {$extraClass} {$thumb_class}'>";
         $output .= !empty($link) ? "<a href='{$link}' data-rel='slide-" . avia_partner_logo::$slider . "' class='slide-image' title='{$linktitle}' {$blank} >{$img}</a>" : $img;
         $output .= "</div>";
         $loop_counter++;
         $slide_loop_count++;
         $extraClass = "";
         if ($loop_counter > $columns) {
             $loop_counter = 1;
             $extraClass = 'first';
         }
         if ($loop_counter == 1 || !empty($last)) {
             $output .= "</div>";
         }
     }
     $output .= "</div>";
     if (count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') {
         if ($navigation == 'dots') {
             $output .= $this->slide_navigation_dots();
         }
     }
     $output .= "</div>";
     return $output;
 }
Ejemplo n.º 26
0
 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
 */
get_header();
$title = tribe_is_month() ? __('Calendar of Events', 'avia_framework') : tribe_get_events_title(false);
$args = array('title' => $title, 'link' => '');
if (!is_singular() || get_post_meta(get_the_ID(), 'header', true) != 'no') {
    echo avia_title($args);
}
?>

		<div class='container_wrap container_wrap_first main_color fullsize'>

			<div class='container'>

				<main class='template-page template-event-page content av-content-full units' <?php 
avia_markup_helper(array('context' => 'content', 'post_type' => 'page'));
?>
>
					
					 <div id="tribe-events-pg-template">
                   
                 	<?php 
tribe_events_before_html();
tribe_get_view();
tribe_events_after_html();
?>
					
					</div> <!-- #tribe-events-pg-template -->
					
				<!--end content-->
				</main>
Ejemplo n.º 27
0
    //copyright
    $copyright = do_shortcode(avia_get_option('copyright', "&copy; " . __('Copyright', 'avia_framework') . "  - <a href='" . home_url('/') . "'>" . get_bloginfo('name') . "</a>"));
    // you can filter and remove the backlink with an add_filter function
    // from your themes (or child themes) functions.php file if you dont want to edit this file
    // you can also just keep that link. I really do appreciate it ;)
    $kriesi_at_backlink = kriesi_backlink(get_option(THEMENAMECLEAN . "_initial_version"));
    //you can also remove the kriesi.at backlink by adding [nolink] to your custom copyright field in the admin area
    if ($copyright && strpos($copyright, '[nolink]') !== false) {
        $kriesi_at_backlink = "";
        $copyright = str_replace("[nolink]", "", $copyright);
    }
    if ($footer_widget_setting != 'nosocket') {
        ?>

				<footer class='container_wrap socket_color' id='socket' <?php 
        avia_markup_helper(array('context' => 'footer'));
        ?>
>
					<div id='socket-company-detail-wrapper'>
						<div class="av-layout-grid-container entry-content-wrapper av-flex-cells container" id='socket-company-detail'>
							<div class="flex_cell no_margin av_one_half  avia-builder-el-35  el_before_av_cell_one_half  avia-builder-el-first no-padding">
								<div class="flex_cell_inner company-detail">
									<p class="font-bold" style="line-height:23px;"><img src="<?php 
        echo get_stylesheet_directory_uri();
        ?>
/images/cg16_home_footer_icon01.png" /> 成功出国留学网&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php 
        echo get_stylesheet_directory_uri();
        ?>
/images/cg16_home_footer_icon02.png" /> 法兰克澳洲留学移民事务所 中国代表处</p>
									<p style="font-size:32px;line-height:32px;">提供一站式澳大利亚留学移民专业服务</p>
									<p style="margin-top:40px; margin-bottom:30px;"><span style="font-size:26px; color:#fff; display:inline-box; -webkit-border-radius: 5; -moz-border-radius: 5; border-radius: 5px;
Ejemplo n.º 28
0
if (strpos($sidebar_pos, 'sidebar_left') !== false) {
    $sidebar = 'left';
}
if (strpos($sidebar_pos, 'sidebar_right') !== false) {
    $sidebar = 'right';
}
//filter the sidebar position (eg woocommerce single product pages always want the same sidebar pos)
$sidebar = apply_filters('avf_sidebar_position', $sidebar);
//if the layout hasnt the sidebar keyword defined we dont need to display one
if (empty($sidebar)) {
    return;
}
if (!empty($avia_config['overload_sidebar'])) {
    $avia_config['currently_viewing'] = $avia_config['overload_sidebar'];
}
echo "<aside class='sidebar sidebar_" . $sidebar . " " . $sidebar_smartphone . " " . avia_layout_class('sidebar', false) . " units' " . avia_markup_helper(array('context' => 'sidebar', 'echo' => false)) . ">";
echo "<div class='inner_sidebar extralight-border'>";
//Display a subnavigation for pages that is automatically generated, so the users do not need to work with widgets
$av_sidebar_menu = avia_sidebar_menu(false);
if ($av_sidebar_menu) {
    echo $av_sidebar_menu;
    $default_sidebar = false;
}
$the_id = @get_the_ID();
$custom_sidebar = "";
if (!empty($the_id) && is_singular()) {
    $custom_sidebar = get_post_meta($the_id, 'sidebar', true);
}
if ($custom_sidebar) {
    dynamic_sidebar($custom_sidebar);
    $default_sidebar = false;
echo avia_title(array('title' => avia_which_archive()));
do_action('ava_after_main_title');
?>

		<div class='container_wrap container_wrap_first main_color <?php 
avia_layout_class('main');
?>
'>

			<div class='container'>

				<main class='template-page template-portfolio content  <?php 
avia_layout_class('content');
?>
 units' <?php 
avia_markup_helper(array('context' => 'content', 'post_type' => 'portfolio'));
?>
>

                    <div class="entry-content-wrapper clearfix">

                        <div class="category-term-description">
                            <?php 
echo term_description();
?>
                        </div>

                    <?php 
$grid = new avia_post_grid(array('linking' => '', 'columns' => '3', 'contents' => 'title', 'sort' => 'no', 'paginate' => 'yes', 'set_breadcrumb' => false));
$grid->use_global_query();
echo $grid->html();
Ejemplo n.º 30
0
 function html()
 {
     if (empty($this->loop)) {
         return;
     }
     $output = "";
     $items = "";
     $size = strpos($this->atts['size'], 'fixed') !== false ? 'fixed' : "flex";
     $auto = strpos($this->atts['size'], 'masonry') !== false ? true : false;
     $manually = strpos($this->atts['size'], 'manually') !== false ? true : false;
     $defaults = array('ID' => '', 'thumb_ID' => '', 'title' => '', 'url' => '', 'class' => array(), 'date' => '', 'excerpt' => '', 'data' => '', 'attachment' => array(), 'attachment_overlay' => array(), 'bg' => "", 'before_content' => '', 'text_before' => '', 'text_after' => '', 'img_before' => '');
     $output .= "<div id='av-masonry-" . self::$element . "' class='av-masonry noHover av-{$size}-size av-{$this->atts['gap']}-gap av-hover-overlay-{$this->atts['overlay_fx']} av-masonry-col-{$this->atts['columns']} av-caption-{$this->atts['caption_display']} {$this->atts['container_class']}' >";
     $output .= $this->atts['sort'] != "no" ? $this->sort_buttons() : "";
     $output .= "<div class='av-masonry-container isotope av-js-disabled ' >";
     $all_sorts = array();
     $sort_array = array();
     foreach ($this->loop as $entry) {
         extract(array_merge($defaults, $entry));
         $img_html = "";
         $img_style = "";
         if ($this->atts['sort'] != "no") {
             $sort_array = $this->sort_array($entry['ID']);
         }
         $class_string = implode(' ', $class) . ' ' . implode(' ', $sort_array);
         $all_sorts = array_merge($all_sorts, $sort_array);
         if (!empty($attachment)) {
             $alt = get_post_meta($thumb_ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = esc_attr(get_the_title($thumb_ID));
             if (isset($attachment[0])) {
                 $img_html = '<img src="' . $attachment[0] . '" title="' . $title . '" alt="' . $alt . '" />';
                 $img_style = 'style="background-image: url(' . $attachment[0] . ');"';
                 $class_string .= " av-masonry-item-with-image";
             }
             if (isset($attachment_overlay[0])) {
                 $over_html = '<img src="' . $attachment_overlay[0] . '" title="' . $title . '" alt="' . $alt . '" />';
                 $over_style = 'style="background-image: url(' . $attachment_overlay[0] . ');"';
                 $img_before = '<div class="av-masonry-image-container av-masonry-overlay" ' . $over_style . '>' . $over_html . '</div>';
             }
             $bg = '<div class="av-masonry-outerimage-container">' . $img_before . '<div class="av-masonry-image-container" ' . $img_style . '>' . $img_html . '</div></div>';
         } else {
             $class_string .= " av-masonry-item-no-image";
         }
         if ($size == 'fixed') {
             if (!empty($attachment) || !empty($before_content)) {
                 if ($auto) {
                     $class_string .= $this->ratio_check_by_image_size($attachment);
                 }
                 if ($manually) {
                     $class_string .= $this->ratio_check_by_tag($entry['tags']);
                 }
             }
         }
         $linktitle = "";
         if ($post_type == 'attachment' && strpos($html_tags[0], 'a href=') !== false) {
             $linktitle = 'title="' . esc_attr($description) . '"';
         } else {
             if (strpos($html_tags[0], 'a href=') !== false) {
                 $linktitle = 'title="' . esc_attr($the_title) . '"';
             }
         }
         $markup = $post_type == 'attachment' ? avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'id' => $entry['ID'], 'custom_markup' => $this->atts['custom_markup'])) : avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $entry['ID'], 'custom_markup' => $this->atts['custom_markup']));
         $items .= "<{$html_tags[0]} class='{$class_string}' {$linktitle} {$markup}>";
         $items .= "<div class='av-inner-masonry-sizer'></div>";
         //responsible for the size
         $items .= "<figure class='av-inner-masonry main_color'>";
         $items .= $bg;
         //title and excerpt
         if ($this->atts['caption_elements'] != 'none' || !empty($text_add)) {
             $items .= "<figcaption class='av-inner-masonry-content site-background'><div class='av-inner-masonry-content-pos'><div class='avia-arrow'></div>" . $text_before;
             if (strpos($this->atts['caption_elements'], 'title') !== false) {
                 $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $entry['ID'], 'custom_markup' => $this->atts['custom_markup']));
                 $items .= "<h3 class='av-masonry-entry-title entry-title' {$markup}>{$the_title}</h3>";
             }
             if (strpos($this->atts['caption_elements'], 'excerpt') !== false && !empty($content)) {
                 $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $entry['ID'], 'custom_markup' => $this->atts['custom_markup']));
                 $items .= "<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";
             }
             $items .= $text_after . "</div></figcaption>";
         }
         $items .= "</figure>";
         $items .= "</{$html_tags[1]}><!--end av-masonry entry-->";
     }
     //if its an ajax call return the items only without container
     if (isset($this->atts['action']) && $this->atts['action'] == 'avia_ajax_masonry_more') {
         return $items;
     }
     // if its no ajax load prepend an empty invisible element as the first element. this is used for calculating the correct width of a default element.
     // in theory this is not necessary because the masonry can detect that with an extra js parameter but sorting becomes slugish if that param is set
     $all_sort_string = implode(' ', array_unique($all_sorts));
     $items = "<div class='av-masonry-entry isotope-item av-masonry-item-no-image {$all_sort_string}'></div>" . $items;
     $output .= $items;
     $output .= "</div>";
     //append pagination
     if ($this->atts['paginate'] == "pagination" && ($avia_pagination = avia_pagination($this->entries->max_num_pages, 'nav'))) {
         $output .= "<div class='av-masonry-pagination av-masonry-pagination-{$this->atts['paginate']}'>{$avia_pagination}</div>";
     } else {
         if ($this->atts['paginate'] == "load_more" && $this->entries->max_num_pages > count($this->entries)) {
             $output .= $this->load_more_button();
         }
     }
     $output .= "</div>";
     return $output;
 }