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;
     }
 }
 function avia_wpml_language_switch()
 {
     global $sitepress, $avia_config;
     if (empty($avia_config['wpml_language_menu_position'])) {
         $avia_config['wpml_language_menu_position'] = apply_filters('avf_wpml_language_switcher_position', 'sub_menu');
     }
     if ($avia_config['wpml_language_menu_position'] != 'sub_menu') {
         return;
     }
     $languages = icl_get_languages('skip_missing=0&orderby=custom');
     $output = "";
     if (is_array($languages)) {
         $output .= "<ul class='avia_wpml_language_switch avia_wpml_language_switch_extra'>";
         foreach ($languages as $lang) {
             $currentlang = ICL_LANGUAGE_CODE == $lang['language_code'] ? 'avia_current_lang' : '';
             if (!avia_is_overview() && (is_home() || is_front_page())) {
                 $lang['url'] = $sitepress->language_url($lang['language_code']);
             }
             $output .= "<li class='language_" . $lang['language_code'] . " {$currentlang}'><a href='" . $lang['url'] . "'>";
             $output .= "\t<span class='language_flag'><img title='" . $lang['native_name'] . "' src='" . $lang['country_flag_url'] . "' alt='" . $lang['native_name'] . "' /></span>";
             $output .= "\t<span class='language_native'>" . $lang['native_name'] . "</span>";
             $output .= "\t<span class='language_translated'>" . $lang['translated_name'] . "</span>";
             $output .= "\t<span class='language_code'>" . $lang['language_code'] . "</span>";
             $output .= "</a></li>";
         }
         $output .= "</ul>";
     }
     echo $output;
 }
function avia_template_helper_get_layout_string($post_type = "")
{
    //$post_type should either be 'page_layout' or 'blog_layout'
    if (!$post_type) {
        $post_type = 'blog_layout';
    }
    if (is_page() && !avia_is_overview()) {
        $post_type = 'page_layout';
    }
    if (is_front_page() && avia_get_option('frontpage') != "") {
        $post_type = 'page_layout';
    }
    if (is_search() || is_404()) {
        $post_type = 'page_layout';
    }
    return $post_type;
}
 function display_small($size = 'page', $showcaption = true, $is_overview = false)
 {
     global $avia_config;
     $this->img_size = $size;
     $this->showcaption = $showcaption;
     $this->show_thumbnails = false;
     if (avia_is_overview() || $is_overview) {
         $this->autoplay = 'false';
         $this->type = $this->defaultSlider;
         $this->slideshowSize = "";
         $this->slider_size_calc();
     }
     if (!$is_overview) {
         if ($this->type != $this->defaultSlider && (!avia_is_overview() && !avia_special_dynamic_template())) {
             return false;
         }
         if ($avia_config['layout'] == 'fullwidth' && !avia_is_overview()) {
             return false;
         }
     }
     return $this->slideshow();
 }