Пример #1
0
    /**
     * Avada Header Template Function
     * @param  string $slider_position Show header below or above slider
     * @return void
     */
    function avada_header_template($slider_position = 'Below')
    {
        $page_id = get_queried_object_id();
        $reverse_position = 'Below' == $slider_position ? 'Above' : 'Below';
        $menu_text_align = '';
        $theme_option_slider_position = Avada()->settings->get('slider_position');
        $page_option_slider_position = fusion_get_page_option('slider_position', $page_id);
        if ((!$theme_option_slider_position || $theme_option_slider_position == $slider_position && $page_option_slider_position != strtolower($reverse_position) || $theme_option_slider_position != $slider_position && $page_option_slider_position == strtolower($slider_position)) && !is_page_template('blank.php') && fusion_get_page_option('display_header', $page_id) != 'no' && Avada()->settings->get('header_position') == 'Top') {
            $header_wrapper_class = 'fusion-header-wrapper';
            $header_wrapper_class .= Avada()->settings->get('header_shadow') ? ' fusion-header-shadow' : '';
            $header_wrapper_class = 'class="' . $header_wrapper_class . '"';
            /**
             * avada_before_header_wrapper hook
             */
            do_action('avada_before_header_wrapper');
            $sticky_header_logo = Avada()->settings->get('sticky_header_logo') ? true : false;
            $mobile_logo = Avada()->settings->get('mobile_logo') ? true : false;
            $sticky_header_type2_layout = '';
            if (in_array(Avada()->settings->get('header_layout'), array('v4', 'v5'))) {
                $sticky_header_type2_layout = 'menu_and_logo' == Avada()->settings->get('header_sticky_type2_layout') ? ' fusion-sticky-menu-and-logo' : ' fusion-sticky-menu-only';
                $menu_text_align = 'fusion-header-menu-align-' . Avada()->settings->get('menu_text_align');
            }
            ?>
			<div <?php 
            echo $header_wrapper_class;
            ?>
>
				<div class="<?php 
            echo sprintf('fusion-header-%s fusion-logo-%s fusion-sticky-menu-%s fusion-sticky-logo-%s fusion-mobile-logo-%s fusion-mobile-menu-design-%s%s %s', Avada()->settings->get('header_layout'), strtolower(Avada()->settings->get('logo_alignment')), has_nav_menu('sticky_navigation'), $sticky_header_logo, $mobile_logo, strtolower(Avada()->settings->get('mobile_menu_design')), $sticky_header_type2_layout, $menu_text_align);
            ?>
">
					<?php 
            /**
             * avada_header hook
             * @hooked avada_secondary_header - 10
             * @hooked avada_header_1 - 20 (adds header content for header v1-v3)
             * @hooked avada_header_2 - 20 (adds header content for header v4-v5)
             */
            do_action('avada_header');
            ?>
				</div>
				<div class="fusion-clearfix"></div>
			</div>
			<?php 
            /**
             * avada_after_header_wrapper hook
             */
            do_action('avada_after_header_wrapper');
        }
    }
     $post_content = ob_get_clean();
     // For boxed layouts add a content separator if there is a post content
     if ($current_page_text_layout == 'boxed' && $post_content) {
         echo '<div class="fusion-content-sep"></div>';
     }
     echo '<div class="fusion-post-content">';
     // Echo the post content
     echo $post_content;
     // On one column layouts render the "Learn More" and "View Project" buttons
     if (strpos($current_page_template, 'one')) {
         echo '<div class="fusion-portfolio-buttons">';
         // Render "Learn More" button
         echo sprintf('<a href="%s" class="fusion-button fusion-button-small fusion-button-default fusion-button-%s fusion-button-%s">%s</a>', $post_permalink, strtolower(Avada()->settings->get('button_shape')), strtolower(Avada()->settings->get('button_type')), __('Learn More', 'Avada'));
         // Render the "View Project" button only is a project url was set
         if (fusion_get_page_option('project_url', $post->ID)) {
             echo sprintf('<a href="%s" class="fusion-button fusion-button-small fusion-button-default fusion-button-%s fusion-button-%s">%s</a>', fusion_get_page_option('project_url', $post->ID), strtolower(Avada()->settings->get('button_shape')), strtolower(Avada()->settings->get('button_type')), __(' View Project', 'Avada'));
         }
         echo '</div>';
     }
     echo '</div>';
     // end post-content
     // On unboxed one column layouts render a separator at the bottom of the post
     if (strpos($current_page_template, 'one') && $current_page_text_layout == 'unboxed') {
         echo '<div class="fusion-clearfix"></div>';
         echo '<div class="fusion-separator sep-double"></div>';
     }
     echo '</div>';
     // end portfolio-content
 }
 // end template check
 // Close fusion-portfolio-content-wrapper for text layouts
Пример #3
0
 /**
  * Render the parent shortcode
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'autoplay' => 'no', 'boxed_text' => 'unboxed', 'cat_slug' => '', 'carousel_layout' => 'title_on_rollover', 'column_spacing' => '12', 'columns' => 3, 'exclude_cats' => '', 'excerpt_length' => '15', 'excerpt_words' => '', 'filters' => 'yes', 'layout' => 'carousel', 'mouse_scroll' => 'no', 'number_posts' => 8, 'offset' => '', 'picture_size' => 'fixed', 'scroll_items' => '', 'show_nav' => 'yes', 'strip_html' => 'yes', 'animation_direction' => 'left', 'animation_speed' => '', 'animation_type' => ''), $args);
     if ($defaults['column_spacing'] === '0') {
         $defaults['column_spacing'] = '0.0';
     }
     if ($defaults['strip_html'] == 'yes') {
         $defaults['strip_html'] = TRUE;
     }
     extract($defaults);
     self::$args = $defaults;
     // Set the image size for the slideshow
     $this->set_image_size();
     // As $excerpt_words is deprecated, only use it when explicity set
     if ($excerpt_words || $excerpt_words === '0') {
         $excerpt_length = $excerpt_words;
     }
     // Transform $cat_slugs to array
     if (self::$args['cat_slug']) {
         $cat_slugs = preg_replace('/\\s+/', '', self::$args['cat_slug']);
         $cat_slugs = explode(',', self::$args['cat_slug']);
     } else {
         $cat_slugs = array();
     }
     // Transform $cats_to_exclude to array
     if (self::$args['exclude_cats']) {
         $cats_to_exclude = preg_replace('/\\s+/', '', self::$args['cat_slug']);
         $cats_to_exclude = explode(',', self::$args['exclude_cats']);
     } else {
         $cats_to_exclude = array();
     }
     // Initialize the query array
     $args = array('post_type' => 'avada_portfolio', 'paged' => 1, 'posts_per_page' => $number_posts, 'has_password' => false);
     if ($defaults['offset']) {
         $args['offset'] = $offset;
     }
     // Check if the are categories that should be excluded
     if (!empty($cats_to_exclude)) {
         // Exclude the correct cats from tax_query
         $args['tax_query'] = array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cats_to_exclude, 'operator' => 'NOT IN'));
         // Include the correct cats in tax_query
         if (!empty($cat_slugs)) {
             $args['tax_query']['relation'] = 'AND';
             $args['tax_query'][] = array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cat_slugs, 'operator' => 'IN');
         }
     } else {
         // Include the cats from $cat_slugs in tax_query
         if (!empty($cat_slugs)) {
             $args['tax_query'] = array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cat_slugs));
         }
     }
     // If placeholder images are disabled, add the _thumbnail_id meta key to the query to only retrieve posts with featured images
     if (!$smof_data['featured_image_placeholder']) {
         $args['meta_key'] = '_thumbnail_id';
     }
     wp_reset_query();
     $recent_works = new WP_Query($args);
     $portfolio_posts = '';
     // Loop through returned posts
     // Setup the inner HTML for each elements
     while ($recent_works->have_posts()) {
         $recent_works->the_post();
         // Reset vars
         $rich_snippets = $post_classes = $title_terms = $image = $post_title = $post_terms = $separator = $post_content = $buttons = $view_project_button = '';
         // For carousels we only need the image and a li wrapper
         if ($layout == 'carousel') {
             // Title on rollover layout
             if ($carousel_layout == 'title_on_rollover') {
                 $show_title = 'default';
                 // Title below image layout
             } else {
                 $show_title = 'disable';
                 // Get the post title
                 $title_terms .= sprintf('<h4 %s><a href="%s" target="%s">%s</a></h4>', FusionCore_Plugin::attributes('fusion-carousel-title'), get_permalink(get_the_ID()), '_self', get_the_title());
                 // Get the terms
                 $title_terms .= get_the_term_list(get_the_ID(), 'portfolio_category', '<div class="fusion-carousel-meta">', ', ', '</div>');
             }
             // Render the video set in page options if no featured image is present
             if (!has_post_thumbnail() && fusion_get_page_option('video', get_the_ID())) {
                 $video_max_width = '540px';
                 $image = sprintf('<div class="fusion-image-wrapper fusion-video" style="max-width:%s;">%s</div>', $video_max_width, fusion_get_page_option('video', get_the_ID()));
             } else {
                 // Get the post image
                 $image = avada_render_first_featured_image_markup(get_the_ID(), $this->image_size, get_permalink(get_the_ID()), TRUE, FALSE, FALSE, 'disable', $show_title, '', $this->recent_works_counter);
             }
             $portfolio_posts .= sprintf('<li %s><div %s>%s%s%s</div></li>', FusionCore_Plugin::attributes('fusion-carousel-item'), FusionCore_Plugin::attributes('fusion-carousel-item-wrapper'), avada_render_rich_snippets_for_pages(), $image, $title_terms);
         } else {
             // Get the post permalink
             $permalink = get_permalink();
             // Include the post categories as css classes for later useage with filters
             $post_categories = get_the_terms(get_the_ID(), 'portfolio_category');
             if ($post_categories) {
                 foreach ($post_categories as $post_category) {
                     $post_classes .= urldecode($post_category->slug) . ' ';
                 }
             }
             // Add the col-spacing class if needed
             if ($column_spacing) {
                 $post_classes .= 'fusion-col-spacing';
             }
             // Render the video set in page options if no featured image is present
             if (!has_post_thumbnail() && fusion_get_page_option('video', get_the_ID())) {
                 $video_max_width = '540px';
                 $image = sprintf('<div class="fusion-image-wrapper fusion-video" style="max-width:%s;">%s</div>', $video_max_width, fusion_get_page_option('video', get_the_ID()));
             } else {
                 // Get the post image
                 $image = avada_render_first_featured_image_markup(get_the_ID(), $this->image_size, get_permalink(get_the_ID()), TRUE, FALSE, FALSE, 'disable', 'default', '', $this->recent_works_counter);
             }
             // Additional content for grid-with-excerpts layout
             if ($layout == 'grid-with-excerpts') {
                 // Get the rich snippets, if enabled
                 $rich_snippets = avada_render_rich_snippets_for_pages(false);
                 // Get the post title
                 $post_title = avada_render_post_title(get_the_ID());
                 // Get the post terms
                 $post_terms = sprintf('<h4>%s</h4>', get_the_term_list(get_the_ID(), 'portfolio_category', '', ', ', ''));
                 // Get the post content
                 ob_start();
                 /**
                  * fusion_recent_works_shortcode_content hook
                  *
                  * @hooked content - 10 (outputs the post content)
                  */
                 do_action('fusion_recent_works_shortcode_content');
                 $stripped_content = ob_get_clean();
                 // For boxed layouts add a content separator if there is a post content
                 if ($boxed_text == 'boxed' && $stripped_content) {
                     $separator = '<div class="fusion-content-sep"></div>';
                 }
                 // On one column layouts render the "Learn More" and "View Project" buttons
                 if ($columns == '1') {
                     $classes = sprintf('fusion-button fusion-button-small fusion-button-default fusion-button-%s fusion-button-%s', strtolower($smof_data['button_shape']), strtolower($smof_data['button_type']));
                     // Add the "Learn More" button
                     $learn_more_button = sprintf('<a href="%s" %s>%s</a>', $permalink, FusionCore_Plugin::attributes($classes), __('Learn More', 'fusion-core'));
                     // If there is a project url, add the "View Project" button
                     $view_project_button = '';
                     if (fusion_get_page_option('project_url', get_the_ID())) {
                         $view_project_button = sprintf('<a href="%s" %s>%s</a>', fusion_get_page_option('project_url', get_the_ID()), FusionCore_Plugin::attributes($classes), __('View Project', 'fusion-core'));
                     }
                     // Wrap buttons
                     $buttons = sprintf('<div %s>%s%s</div>', FusionCore_Plugin::attributes('fusion-portfolio-buttons'), $learn_more_button, $view_project_button);
                 }
                 // Put it all together
                 $post_content = sprintf('<div %s>%s%s%s<div %s>%s%s</div></div>', FusionCore_Plugin::attributes('fusion-portfolio-content'), $post_title, $post_terms, $separator, FusionCore_Plugin::attributes('fusion-post-content'), $stripped_content, $buttons);
             } else {
                 // Get the rich snippets for grid layout without excerpts
                 $rich_snippets = avada_render_rich_snippets_for_pages();
             }
             $portfolio_posts .= sprintf('<div %s><div %s>%s%s%s</div></div>', FusionCore_Plugin::attributes('fusion-portfolio-post ' . $post_classes), FusionCore_Plugin::attributes('fusion-portfolio-content-wrapper'), $rich_snippets, $image, $post_content);
         }
     }
     // end while
     wp_reset_query();
     // Wrap all the portfolio posts with the appropriate HTML markup
     // Carousel layout
     if ($layout == 'carousel') {
         $main_carousel = sprintf('<ul %s>%s</ul>', FusionCore_Plugin::attributes('fusion-carousel-holder'), $portfolio_posts);
         // Check if navigation should be shown
         $navigation = '';
         if ($show_nav == 'yes') {
             $navigation = sprintf('<div %s><span %s></span><span %s></span></div>', FusionCore_Plugin::attributes('fusion-carousel-nav'), FusionCore_Plugin::attributes('fusion-nav-prev'), FusionCore_Plugin::attributes('fusion-nav-next'));
         }
         $html = sprintf('<div %s><div %s><div %s>%s%s</div></div></div>', FusionCore_Plugin::attributes('recentworks-shortcode'), FusionCore_Plugin::attributes('recentworks-shortcode-carousel'), FusionCore_Plugin::attributes('fusion-carousel-positioner'), $main_carousel, $navigation);
         // Grid layouts
     } else {
         // Reset vars
         $filter_wrapper = $filter = $styles = '';
         // Setup the filters, if enabled
         $portfolio_categories = get_terms('portfolio_category');
         // Check if filters should be displayed
         if ($portfolio_categories && $filters != 'no') {
             // Check if the "All" filter should be displayed
             if ($filters != 'yes-without-all') {
                 $filter = sprintf('<li %s><a %s>%s</a></li>', FusionCore_Plugin::attributes('fusion-filter fusion-filter-all fusion-active'), FusionCore_Plugin::attributes('recentworks-shortcode-filter-link', array('data-filter' => '*')), __('All', 'fusion-core'));
                 $first_filter = FALSE;
             } else {
                 $first_filter = TRUE;
             }
             // Loop through categories
             foreach ($portfolio_categories as $portfolio_category) {
                 // Only display filters of non excluded categories
                 if (!in_array($portfolio_category->slug, $cats_to_exclude)) {
                     // Check if categories have been chosen
                     if (!empty(self::$args['cat_slug'])) {
                         // Only display filters for explicitly included categories
                         if (in_array($portfolio_category->slug, $cat_slugs)) {
                             // Set the first category filter to active, if the all filter isn't shown
                             $active_class = '';
                             if ($first_filter) {
                                 $active_class = ' fusion-active';
                                 $first_filter = FALSE;
                             }
                             $filter .= sprintf('<li %s><a %s>%s</a></li>', FusionCore_Plugin::attributes('fusion-filter fusion-hidden' . $active_class), FusionCore_Plugin::attributes('recentworks-shortcode-filter-link', array('data-filter' => '.' . $portfolio_category->slug)), $portfolio_category->name);
                         }
                         // Display all categories
                     } else {
                         // Set the first category filter to active, if the all filter isn't shown
                         $active_class = '';
                         if ($first_filter) {
                             $active_class = ' fusion-active';
                             $first_filter = FALSE;
                         }
                         $filter .= sprintf('<li %s><a %s>%s</a></li>', FusionCore_Plugin::attributes('fusion-filter fusion-hidden' . $active_class), FusionCore_Plugin::attributes('recentworks-shortcode-filter-link', array('data-filter' => '.' . $portfolio_category->slug)), $portfolio_category->name);
                     }
                 }
             }
             // end foreach
             // Wrap filters
             $filter_wrapper = sprintf('<ul %s>%s</ul>', FusionCore_Plugin::attributes('fusion-filters'), $filter);
         }
         // For column spacing set needed css
         if ($column_spacing) {
             $styles = sprintf('<style type="text/css">.fusion-recent-works-%s .fusion-portfolio-wrapper .fusion-col-spacing{padding:%spx;}</style>', $this->recent_works_counter, $column_spacing / 2);
         }
         // Put it all together
         $html = sprintf('<div %s>%s%s<div %s>%s</div></div>', FusionCore_Plugin::attributes('recentworks-shortcode'), $filter_wrapper, $styles, FusionCore_Plugin::attributes('recentworks-shortcode-portfolio-wrapper'), $portfolio_posts);
     }
     $this->recent_works_counter++;
     return $html;
 }
Пример #4
0
		<?php 
}
?>
		<?php 
$main_css = '';
$row_css = '';
$main_class = '';
$page_template = '';
if (function_exists('is_woocommerce') && is_woocommerce()) {
    $custom_fields = get_post_custom_values('_wp_page_template', $c_pageID);
    $page_template = is_array($custom_fields) && !empty($custom_fields) ? $custom_fields[0] : '';
}
if (get_post_type($c_pageID) == 'tribe_events' && tribe_get_option('tribeEventsTemplate', 'default') == '100-width.php') {
    $page_template = '100-width.php';
}
if (is_page_template('100-width.php') || is_page_template('blank.php') || '100-width.php' == $page_template || ('1' == fusion_get_option('portfolio_width_100', 'portfolio_width_100', $c_pageID) || 'yes' == fusion_get_option('portfolio_width_100', 'portfolio_width_100', $c_pageID)) && 'avada_portfolio' == get_post_type($c_pageID) || ('1' == fusion_get_option('blog_width_100', 'portfolio_width_100', $c_pageID) || 'yes' == fusion_get_option('blog_width_100', 'portfolio_width_100', $c_pageID)) && 'post' == get_post_type($c_pageID) || 'yes' == fusion_get_page_option('portfolio_width_100', $c_pageID) && ('post' != get_post_type($c_pageID) && 'avada_portfolio' != get_post_type($c_pageID)) || avada_is_portfolio_template() && 'yes' == get_post_meta($c_pageID, 'pyre_portfolio_width_100', true)) {
    $main_css = 'padding-left:0px;padding-right:0px;';
    if (Avada()->settings->get('hundredp_padding') && !get_post_meta($c_pageID, 'pyre_hundredp_padding', true)) {
        $main_css = 'padding-left:' . Avada()->settings->get('hundredp_padding') . ';padding-right:' . Avada()->settings->get('hundredp_padding');
    }
    if (get_post_meta($c_pageID, 'pyre_hundredp_padding', true)) {
        $main_css = 'padding-left:' . get_post_meta($c_pageID, 'pyre_hundredp_padding', true) . ';padding-right:' . get_post_meta($c_pageID, 'pyre_hundredp_padding', true);
    }
    $row_css = 'max-width:100%;';
    $main_class = 'width-100';
}
do_action('avada_before_main_container');
?>
		<div id="main" class="clearfix <?php 
echo $main_class;
?>
Пример #5
0
 /**
  * Return the post content, either excerpted or in full length
  * @param  string	$page_id		The id of the current page or post
  * @param  string 	$excerpt		Can be either 'blog' (for main blog page), 'portfolio' (for portfolio page template) or 'yes' (for shortcodes)
  * @param  integer	$excerpt_length Length of the excerpts
  * @param  boolean	$strip_html		Can be used by shortcodes for a custom strip html setting
  *
  * @return string Post content
  **/
 function fusion_get_post_content($page_id = '', $excerpt = 'blog', $excerpt_length = 55, $strip_html = FALSE)
 {
     $content_excerpted = FALSE;
     // Main blog page
     if ($excerpt == 'blog') {
         // Check if the content should be excerpted
         if (strtolower(fusion_get_theme_option('content_length')) == 'excerpt') {
             $content_excerpted = TRUE;
             // Get the excerpt length
             $excerpt_length = fusion_get_theme_option('excerpt_length_blog');
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Portfolio page templates
     } elseif ($excerpt == 'portfolio') {
         // Check if the content should be excerpted
         if (fusion_get_option('portfolio_content_length', 'portfolio_content_length', $page_id) == 'excerpt') {
             $content_excerpted = TRUE;
             // Determine the correct excerpt length
             if (fusion_get_page_option('portfolio_excerpt', $page_id)) {
                 $excerpt_length = fusion_get_page_option('portfolio_excerpt', $page_id);
             } else {
                 $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio');
             }
         } else {
             if (!$page_id && fusion_get_theme_option('portfolio_content_length') == 'Excerpt') {
                 $content_excerpted = TRUE;
                 $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio');
             }
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('portfolio_strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Shortcodes
     } elseif ($excerpt == 'yes') {
         $content_excerpted = TRUE;
     }
     // Sermon specific additional content
     if ('wpfc_sermon' == get_post_type(get_the_ID())) {
         $sermon_content = '';
         $sermon_content .= avada_get_sermon_content(true);
         return $sermon_content;
     }
     // Return excerpted content
     if ($content_excerpted) {
         $stripped_content = fusion_get_post_content_excerpt($excerpt_length, $strip_html);
         return $stripped_content;
         // Return full content
     } else {
         ob_start();
         the_content();
         return ob_get_clean();
     }
 }
Пример #6
0
function filter_DisplayFilters($current_page_id, $taxonomy_slugs_names, $taxonomy_name)
{
    // group with a sub-set
    echo sprintf('<li id="filter-%s" class="menu-item menu-item-has-children fusion-dropdown-menu">', $taxonomy_name);
    echo sprintf('<a aria-haspopup="true" href="#"><span class="menu-text">%s</span></a><ul class="sub-menu">', $taxonomy_name);
    // Check if the "All" filter should be displayed
    $need_active = TRUE;
    if (fusion_get_page_option('portfolio_filters', $current_page_id) == 'yes') {
        echo sprintf('<li class="menu-item fusion-dropdown-submenu fusion-filter fusion-filter-all fusion-active"><a data-filter="*" href="#">%s</a></li>', apply_filters('avada_portfolio_all_filter_name', __('All', 'Avada')));
        $need_active = FALSE;
    }
    foreach ($taxonomy_slugs_names as $category_tax_slug => $category_tax_name) {
        // Set the first category filter to active, if the all filter isn't shown
        $active_class = '';
        if ($need_active) {
            $active_class = ' fusion-active';
            $need_active = FALSE;
        }
        echo sprintf('<li class="menu-item fusion-dropdown-submenu fusion-filter fusion-hidden%s"><a data-filter=".%s" href="#">%s</a></li>', $active_class, urldecode($category_tax_slug), $category_tax_name);
    }
    echo '</ul></li>';
}
Пример #7
0
 /**
  * Render the post title as linked h1 tag
  *
  * @return string The post title as linked h1 tag
  **/
 function avada_render_post_title($post_id = '', $linked = TRUE, $custom_title = '', $custom_size = '2')
 {
     $entry_title_class = '';
     // Add the entry title class if rich snippets are enabled
     if (!Avada()->settings->get('disable_date_rich_snippet_pages')) {
         $entry_title_class = ' class="entry-title"';
     }
     // If we have a custom title, use it
     if ($custom_title) {
         $title = $custom_title;
         // Otherwise get post title
     } else {
         $title = get_the_title($post_id);
     }
     // If the post title should be linked at the markup
     if ($linked) {
         $link_target = '';
         if (fusion_get_page_option('link_icon_target', $post_id) == 'yes' || fusion_get_page_option('post_links_target', $post_id) == 'yes') {
             $link_target = ' target="_blank"';
         }
         $title = sprintf('<a href="%s"%s>%s</a>', get_permalink($post_id), $link_target, $title);
     }
     // Setup the HTML markup of the post title
     $html = sprintf('<h%s%s>%s</h%s>', $custom_size, $entry_title_class, $title, $custom_size);
     return $html;
 }
Пример #8
0
    function avada_render_rollover($post_id, $post_permalink = '', $display_woo_price = false, $display_woo_buttons = false, $display_post_categories = 'default', $display_post_title = 'default', $gallery_id = '')
    {
        // Retrieve the permalink if it is not set
        if (!$post_permalink) {
            $post_permalink = get_permalink($post_id);
        }
        // Check if theme options are used as base or if there is an override for post categories
        if ('enable' == $display_post_categories) {
            $display_post_categories = true;
        } elseif ('disable' == $display_post_categories) {
            $display_post_categories = false;
        } else {
            $display_post_categories = !Avada()->settings->get('cats_image_rollover');
        }
        // Check if theme options are used as base or if there is an override for post title
        if ('enable' == $display_post_title) {
            $display_post_title = true;
        } elseif ('disable' == $display_post_title) {
            $display_post_title = false;
        } else {
            $display_post_title = !Avada()->settings->get('title_image_rollover');
        }
        // Set the link on the link icon to a custom url if set in page options
        $icon_permalink = fusion_get_page_option('link_icon_url', $post_id) != null ? fusion_get_page_option('link_icon_url', $post_id) : $post_permalink;
        if ('' == fusion_get_page_option('image_rollover_icons', $post_id) || 'default' == fusion_get_page_option('image_rollover_icons', $post_id)) {
            if (!Avada()->settings->get('link_image_rollover') && !Avada()->settings->get('zoom_image_rollover')) {
                // link + zoom
                $image_rollover_icons = 'linkzoom';
            } elseif (!Avada()->settings->get('link_image_rollover') && Avada()->settings->get('zoom_image_rollover')) {
                // link
                $image_rollover_icons = 'link';
            } elseif (Avada()->settings->get('link_image_rollover') && !Avada()->settings->get('zoom_image_rollover')) {
                // zoom
                $image_rollover_icons = 'zoom';
            } elseif (Avada()->settings->get('link_image_rollover') && Avada()->settings->get('zoom_image_rollover')) {
                // link
                $image_rollover_icons = 'no';
            } else {
                $image_rollover_icons = 'linkzoom';
            }
        } else {
            $image_rollover_icons = fusion_get_page_option('image_rollover_icons', $post_id);
        }
        //$image_rollover_icons = 'zoom';
        // Set the link target to blank if the option is set
        $link_target = 'yes' == fusion_get_page_option('link_icon_target', $post_id) || 'yes' == fusion_get_page_option('post_links_target', $post_id) ? ' target="_blank"' : '';
        ?>

		<div class="fusion-rollover">

			<div class="fusion-rollover-content">

				<?php 
        if ('no' != $image_rollover_icons && 'product' != get_post_type($post_id)) {
            // Check if rollover icons should be displayed
            ?>

					<?php 
            if ('zoom' != $image_rollover_icons) {
                // If set, render the rollover link icon
                ?>
						<a class="fusion-rollover-link" href="<?php 
                echo $icon_permalink;
                ?>
"<?php 
                echo $link_target;
                ?>
>Permalink</a>
					<?php 
            }
            ?>

					<?php 
            if ('link' != $image_rollover_icons) {
                // If set, render the rollover zoom icon
                ?>
						<?php 
                // Get the image data
                $full_image = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'full');
                if (!is_array($full_image)) {
                    $full_image = array();
                    $full_image[0] = '';
                }
                // If a video url is set in the post options, use it inside the lightbox
                if (fusion_get_page_option('video_url', $post_id)) {
                    $full_image[0] = fusion_get_page_option('video_url', $post_id);
                }
                ?>

						<?php 
                if ('linkzoom' == $image_rollover_icons || '' === $image_rollover_icons) {
                    // If both icons will be shown, add a separator
                    ?>
							<div class="fusion-rollover-sep"></div>
						<?php 
                }
                ?>

						<?php 
                if ($full_image[0]) {
                    // Render the rollover zoom icon if we have an image
                    ?>
							<?php 
                    // Only show images of the clicked post
                    if ('individual' == Avada()->settings->get('lightbox_behavior')) {
                        $lightbox_content = avada_featured_images_lightbox($post_id);
                        $data_rel = sprintf('iLightbox[gallery%s]', $post_id);
                        // Show the first image of every post on the archive page
                    } else {
                        $lightbox_content = '';
                        $data_rel = sprintf('iLightbox[gallery%s]', $gallery_id);
                    }
                    ?>
						<?php 
                }
                ?>
					<?php 
            }
            ?>
				<?php 
        }
        ?>


				<?php 
        // Check if we should render the post categories on the rollover
        if ($display_post_categories) {
            // Determine the correct taxonomy
            if ('post' == get_post_type($post_id)) {
                $post_taxonomy = 'category';
            } elseif ('avada_portfolio' == get_post_type($post_id)) {
                $post_taxonomy = 'portfolio_category';
            } elseif ('product' == get_post_type($post_id)) {
                $post_taxonomy = 'product_cat';
            }
            if ('avada_portfolio' == get_post_type($post_id)) {
            } else {
                echo get_the_term_list($post_id, $post_taxonomy, '<div class="fusion-rollover-categories">', ', ', '</div>');
            }
        }
        ?>

				<?php 
        if ($display_woo_price) {
            // Check if we should render the woo product price
            ?>
					<?php 
            woocommerce_get_template('loop/price.php');
            ?>
				<?php 
        }
        ?>

				<?php 
        if ($display_woo_buttons) {
            // Check if we should render the woo "add to cart" and "details" buttons
            ?>
					<div class="fusion-product-buttons">
						<?php 
            woocommerce_get_template('loop/add-to-cart.php');
            ?>
						<span class="fusion-rollover-linebreak"></span>
						<a class="fusion-show-details-button" href="<?php 
            echo post_permalink();
            ?>
"><?php 
            _e('Details', 'Avada');
            ?>
</a>
					</div>
				<?php 
        }
        ?>
			</div>

		</div>

		<?php 
    }
Пример #9
0
 function read_more()
 {
     if (self::$args['meta_link']) {
         $inner_content = '';
         if (self::$args['meta_read']) {
             if (self::$args['layout'] == 'grid' || self::$args['layout'] == 'timeline') {
                 $read_more_wrapper_class = 'fusion-alignleft';
             } else {
                 $read_more_wrapper_class = 'fusion-alignright';
             }
             $link_target = '';
             if (fusion_get_page_option('link_icon_target', get_the_ID()) == 'yes' || fusion_get_page_option('post_links_target', get_the_ID()) == 'yes') {
                 $link_target = ' target="_blank"';
             }
             $inner_content .= sprintf('<div %s><a class="fusion-read-more" href="%s"%s>%s</a></div>', FusionCore_Plugin::attributes($read_more_wrapper_class), get_permalink(), $link_target, apply_filters('avada_blog_read_more_link', __('Read More', 'fusion-core')));
             if (self::$args['layout'] == 'large-alternate' || self::$args['layout'] == 'medium-alternate') {
                 $inner_content = sprintf('<div class="fusion-meta-info">%s</div>', $inner_content);
             }
         }
         return $inner_content;
     }
 }
Пример #10
0
" class="fusion-button fusion-button-small fusion-button-default fusion-button-<?php 
                echo strtolower(Avada()->settings->get('button_shape'));
                ?>
 fusion-button-<?php 
                echo strtolower(Avada()->settings->get('button_type'));
                ?>
">
											<?php 
                esc_html_e('Learn More', 'Avada');
                ?>
										</a>
										<?php 
                if (fusion_get_page_option('project_url', $post->ID)) {
                    ?>
											<a href="<?php 
                    echo fusion_get_page_option('project_url', $post->ID);
                    ?>
" class="fusion-button fusion-button-small fusion-button-default fusion-button-<?php 
                    echo strtolower(Avada()->settings->get('button_shape'));
                    ?>
 fusion-button-<?php 
                    echo strtolower(Avada()->settings->get('button_type'));
                    ?>
">
												<?php 
                    esc_html_e('View Project', 'Avada');
                    ?>
											</a>
										<?php 
                }
                ?>
Пример #11
0
 /**
  * Return the post content, either excerpted or in full length
  * @param  string	$page_id		The id of the current page or post
  * @param  string 	$excerpt		Can be either 'blog' (for main blog page), 'portfolio' (for portfolio page template) or 'yes' (for shortcodes)
  * @param  integer	$excerpt_length Length of the excerpts
  * @param  boolean	$strip_html		Can be used by shortcodes for a custom strip html setting
  *
  * @return string Post content
  **/
 function fusion_get_post_content($page_id = '', $excerpt = 'blog', $excerpt_length = 55, $strip_html = FALSE)
 {
     global $smof_data;
     $content_excerpted = FALSE;
     // Main blog page
     if ($excerpt == 'blog') {
         // Check if the content should be excerpted
         if (strtolower(fusion_get_theme_option('content_length')) == 'excerpt') {
             $content_excerpted = TRUE;
             // Get the excerpt length
             $excerpt_length = fusion_get_theme_option('excerpt_length_blog');
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Portfolio page templates
     } elseif ($excerpt == 'portfolio') {
         // Check if the content should be excerpted
         if (fusion_get_option('portfolio_content_length', 'portfolio_content_length', $page_id) == 'excerpt') {
             $content_excerpted = TRUE;
             // Determine the correct excerpt length
             if (fusion_get_page_option('portfolio_excerpt', $page_id)) {
                 $excerpt_length = fusion_get_page_option('portfolio_excerpt', $page_id);
             } else {
                 $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio');
             }
         }
         // Check if HTML should be stripped from contant
         if (fusion_get_theme_option('portfolio_strip_html_excerpt')) {
             $strip_html = TRUE;
         }
         // Shortcodes
     } elseif ($excerpt == 'yes') {
         $content_excerpted = TRUE;
     }
     // Return excerpted content
     if ($content_excerpted) {
         $stripped_content = fusion_get_post_content_excerpt($excerpt_length, $strip_html);
         return $stripped_content;
         // Return full content
     } else {
         ob_start();
         the_content();
         return ob_get_clean();
     }
 }
Пример #12
0
/**
 * Returns the excerpt length for portfolio posts.
 *
 * @since 4.0.0
 *
 * @param  string	$page_id		The id of the current page or post
 *
 * @return string/boolean The excerpt length for the post; false if full content should be shown
 **/
function avada_get_portfolio_excerpt_length($page_id = '')
{
    $excerpt_length = false;
    if (fusion_get_option('portfolio_content_length', 'portfolio_content_length', $page_id) == 'excerpt') {
        // Determine the correct excerpt length
        if (fusion_get_page_option('portfolio_excerpt', $page_id)) {
            $excerpt_length = fusion_get_page_option('portfolio_excerpt', $page_id);
        } else {
            $excerpt_length = Avada()->settings->get('excerpt_length_portfolio');
        }
    } else {
        if (!$page_id && Avada()->settings->get('portfolio_content_length') == 'Excerpt') {
            $excerpt_length = Avada()->settings->get('excerpt_length_portfolio');
        }
    }
    return $excerpt_length;
}
Пример #13
0
        // Get the image data
        ?>
				<?php 
        $full_image = !is_array($full_image) ? array(0 => '') : $full_image;
        ?>

				<?php 
        /**
         * If a video url is set in the post options, use it inside the lightbox
         */
        ?>
				<?php 
        if (fusion_get_page_option('video_url', $post_id)) {
            ?>
					<?php 
            $full_image[0] = fusion_get_page_option('video_url', $post_id);
            ?>
				<?php 
        }
        ?>

				<?php 
        /**
         * If both icons will be shown, add a separator
         */
        ?>
				<?php 
        if ('linkzoom' == $image_rollover_icons || '' === $image_rollover_icons) {
            ?>
					<div class="fusion-rollover-sep"></div>
				<?php 
Пример #14
0
 /**
  * Render the post title as linked h1 tag
  *
  * @return string The post title as linked h1 tag
  **/
 function avada_render_post_title($post_id = '', $linked = true, $custom_title = '', $custom_size = '2')
 {
     $entry_title_class = '';
     // Add the entry title class if rich snippets are enabled
     if (Avada()->settings->get('disable_date_rich_snippet_pages')) {
         $entry_title_class = ' class="entry-title"';
     }
     // If we have a custom title, use it otherwise get post title
     $title = $custom_title ? $custom_title : get_the_title($post_id);
     // If the post title should be linked at the markup
     if ($linked) {
         $link_target = '';
         if ('yes' == fusion_get_page_option('link_icon_target', $post_id) || 'yes' == fusion_get_page_option('post_links_target', $post_id)) {
             $link_target = ' target="_blank"';
         }
         $title = '<a href="' . get_permalink($post_id) . '"' . $link_target . '>' . $title . '</a>';
     }
     // return the HTML markup of the post title
     return '<h' . $custom_size . $entry_title_class . '>' . $title . '</h' . $custom_size . '>';
 }
do_action('tribe_events_before_the_content');
?>
			<div class="fusion-post-content-container">
				<?php 
echo tribe_events_get_the_excerpt();
?>
			</div>
			<?php 
do_action('tribe_events_after_the_content');
?>

			<div class="fusion-meta-info">
				<div class="fusion-alignleft">
					<?php 
if (!Avada()->settings->get('post_meta_read')) {
    $link_target = '';
    if (fusion_get_page_option('link_icon_target', get_the_ID()) == 'yes' || fusion_get_page_option('post_links_target', get_the_ID()) == 'yes') {
        $link_target = ' target="_blank"';
    }
    echo sprintf('<a href="%s" class="fusion-read-more"%s>%s</a>', get_permalink(), $link_target, __('Find Out More', 'Avada'));
}
?>
				</div>
			</div>

		</div>

	</div><!-- /.tribe-events-event-details -->

</div><!-- /.tribe-events-photo-event-wrap -->
Пример #16
0
    /**
     * Avada Header Template Function
     * @param  string $slider_position Show header below or above slider
     * @return void
     */
    function avada_header_template($slider_position = 'Below')
    {
        $page_id = get_queried_object_id();
        if ($slider_position == 'Below') {
            $reverse_position = 'Above';
        } else {
            $reverse_position = 'Below';
        }
        $theme_option_slider_position = fusion_get_theme_option('slider_position');
        $page_option_slider_position = fusion_get_page_option('slider_position', $page_id);
        if ((!$theme_option_slider_position || $theme_option_slider_position == $slider_position && $page_option_slider_position != strtolower($reverse_position) || $theme_option_slider_position != $slider_position && $page_option_slider_position == strtolower($slider_position)) && !is_page_template('blank.php') && fusion_get_page_option('display_header', $page_id) != 'no' && fusion_get_theme_option('header_position') == 'Top') {
            $header_wrapper_class = 'fusion-header-wrapper';
            if (fusion_get_theme_option('header_shadow')) {
                $header_wrapper_class .= ' fusion-header-shadow';
            }
            $header_wrapper_class = sprintf('class="%s"', $header_wrapper_class);
            /**
             * avada_before_header_wrapper hook
             */
            do_action('avada_before_header_wrapper');
            if (fusion_get_theme_option('sticky_header_logo')) {
                $sticky_header_logo = true;
            } else {
                $sticky_header_logo = false;
            }
            if (fusion_get_theme_option('mobile_logo')) {
                $mobile_logo = true;
            } else {
                $mobile_logo = false;
            }
            $sticky_header_type2_layout = '';
            if (fusion_get_theme_option('header_layout') == 'v4' || fusion_get_theme_option('header_layout') == 'v5') {
                if (fusion_get_theme_option('header_sticky_type2_layout') == 'menu_and_logo') {
                    $sticky_header_type2_layout = ' fusion-sticky-menu-and-logo';
                } else {
                    $sticky_header_type2_layout = ' fusion-sticky-menu-only';
                }
            }
            ?>
			<div <?php 
            echo $header_wrapper_class;
            ?>
>
				<div class="<?php 
            echo sprintf('fusion-header-%s fusion-logo-%s fusion-sticky-menu-%s fusion-sticky-logo-%s fusion-mobile-logo-%s fusion-mobile-menu-design-%s%s', fusion_get_theme_option('header_layout'), strtolower(fusion_get_theme_option('logo_alignment')), has_nav_menu('sticky_navigation'), $sticky_header_logo, $mobile_logo, strtolower(fusion_get_theme_option('mobile_menu_design')), $sticky_header_type2_layout);
            ?>
">
					<?php 
            /**
             * avada_header hook
             * @hooked avada_secondary_header - 10
             * @hooked avada_header_1 - 20 (adds header content for header v1-v3)
             * @hooked avada_header_2 - 20 (adds header content for header v4-v5)
             */
            do_action('avada_header');
            ?>
				</div>
			</div>
		<?php 
            /**
             * avada_after_header_wrapper hook
             */
            do_action('avada_after_header_wrapper');
        }
    }
Пример #17
0
		<?php 
}
?>
		<?php 
$main_css = '';
$row_css = '';
$main_class = '';
$page_template = '';
if (function_exists('is_woocommerce') && is_woocommerce()) {
    $custom_fields = get_post_custom_values('_wp_page_template', $c_pageID);
    $page_template = is_array($custom_fields) && !empty($custom_fields) ? $custom_fields[0] : '';
}
if ('tribe_events' == get_post_type($c_pageID) && '100-width.php' == tribe_get_option('tribeEventsTemplate', 'default')) {
    $page_template = '100-width.php';
}
if (is_page_template('100-width.php') || is_page_template('blank.php') || '100-width.php' == $page_template || ('1' == fusion_get_option('portfolio_width_100', 'portfolio_width_100', $c_pageID) || 'yes' == fusion_get_option('portfolio_width_100', 'portfolio_width_100', $c_pageID)) && is_singular('avada_portfolio') || ('1' == fusion_get_option('blog_width_100', 'portfolio_width_100', $c_pageID) || 'yes' == fusion_get_option('blog_width_100', 'portfolio_width_100', $c_pageID)) && is_singular('post') || 'yes' == fusion_get_page_option('portfolio_width_100', $c_pageID) && !is_singular(array('post', 'avada_portfolio')) || avada_is_portfolio_template() && 'yes' == get_post_meta($c_pageID, 'pyre_portfolio_width_100', true)) {
    $main_css = 'padding-left:0px;padding-right:0px;';
    if (Avada()->settings->get('hundredp_padding') && !get_post_meta($c_pageID, 'pyre_hundredp_padding', true)) {
        $main_css = 'padding-left:' . Avada()->settings->get('hundredp_padding') . ';padding-right:' . Avada()->settings->get('hundredp_padding');
    }
    if (get_post_meta($c_pageID, 'pyre_hundredp_padding', true)) {
        $main_css = 'padding-left:' . get_post_meta($c_pageID, 'pyre_hundredp_padding', true) . ';padding-right:' . get_post_meta($c_pageID, 'pyre_hundredp_padding', true);
    }
    $row_css = 'max-width:100%;';
    $main_class = 'width-100';
}
do_action('avada_before_main_container');
?>
		<div id="main" class="clearfix <?php 
echo $main_class;
?>