Exemplo n.º 1
0
function ts_portfolio_item_func($atts, $content = null)
{
    extract(shortcode_atts(array('animation' => '', 'animation_delay' => '', 'animation_iteration' => '', 'id' => 0), $atts));
    global $post;
    $html = '';
    $new_post = null;
    if (!empty($id)) {
        $new_post = get_post($id);
    }
    if ($new_post) {
        $post = $new_post;
        setup_postdata($post);
        $image = '';
        $slider = '';
        $portfolio_slider = ts_get_post_opt('portfolio_slider');
        if (is_array($portfolio_slider) && count($portfolio_slider) > 0) {
            foreach ($portfolio_slider as $slide) {
                if (!empty($slide['image'])) {
                    $image = theme_thumb($slide['image'], 370, 270, 'c');
                }
                $slider .= ' 
					<div class="col-sm-12 col-md-12">
					  <img src="' . esc_url($image) . '" alt="" title="">
					</div>';
            }
        }
        if (!empty($slider)) {
            $gallery = '
				<div class="carousel-box load" data-carousel-pagination="true" data-carousel-nav="false" data-carousel-one="true">
					<div class="row">
						<div class="carousel">' . $slider . '</div>
					</div>
					<div class="clearfix"></div>
					<div class="pagination switches"></div>
				</div>';
        } else {
            $gallery = '<img src="' . esc_url(get_xv_thumbnail(370, 270)) . '" class="single-image" />';
        }
        $html = '
			<div class="work-single row ' . ts_get_animation_class($animation) . '" ' . ts_get_animation_data_class($animation_delay, $animation_iteration) . '>
				<div class="images-box col-sm-5 col-md-4">
					' . $gallery . '
				</div>

				<div class="work-description col-sm-7 col-md-8">
				  <h3 class="title">' . get_the_title() . '</h3>
				  <div class="type">' . xv_get_field('client') . '</div>

				  <div>
					' . apply_filters('the_content', get_the_content()) . '
					<div class="tags"><b>' . __('Categories', 'progressive') . ': </b>' . strip_tags(get_the_term_list($post->ID, 'portfolio_category', '', ', ')) . '</div>
				  </div>
				</div>
				<div class="clearfix"></div>
			  </div>';
        wp_reset_postdata();
    }
    return $html;
}
Exemplo n.º 2
0
function ts_banner_carousel_func($atts, $content = null)
{
    global $post;
    extract(shortcode_atts(array('animation' => '', 'animation_delay' => '', 'animation_delay_item' => '', 'animation_iteration' => '', 'carousel_style' => '', 'full_width_lines' => '', 'category' => '', 'limit' => 10), $atts));
    // Reset and setup variables
    $output = '';
    $temp_title = '';
    $temp_link = '';
    $carousel_classes = '';
    if ($carousel_style == 'mini') {
        $width = 127;
        $height = 79;
        $carousel_classes = 'banner-set-mini banner-set-no-pagination';
    } else {
        $width = 253;
        $height = 158;
    }
    if ($full_width_lines == 'enabled') {
        $carousel_classes .= ' banner-border-shop';
    }
    $output .= "<div class='banner-set load " . sanitize_html_classes($carousel_classes) . "'>\n            <div class='container'>\n              <div class='banners'>";
    $args = array('post_type' => 'banner', 'posts_per_page' => $limit);
    if (!empty($category)) {
        $args['tax_query'] = array(array('taxonomy' => 'banner-cat', 'field' => 'id', 'terms' => $category));
    }
    $current_animation_delay = $animation_delay;
    query_posts($args);
    // the loop
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            $temp_title = get_the_title($post->ID);
            $url = xv_get_field('url');
            $temp_link = '#';
            if ($url) {
                $temp_link = $url;
            }
            $excerpt = get_xv_excerpt(250);
            // output all findings - CUSTOMIZE TO YOUR LIKING
            $output .= "<a  class='banner " . ts_get_animation_class($animation) . "' href='" . esc_url($temp_link) . "' " . ts_get_animation_data_class($current_animation_delay, $animation_iteration) . ">";
            $thumb = get_xv_thumbnail($width, $height);
            $output .= '<img src="' . esc_url($thumb) . '" alt="' . the_title_attribute('echo=0') . '" />';
            $output .= "<h2 class='title'>{$temp_title}</h2>";
            if ($carousel_style != 'mini') {
                $output .= "<div class='description'>{$excerpt}</div>";
            }
            $output .= "</a>";
            $current_animation_delay += $animation_delay_item;
        }
    }
    wp_reset_query();
    $output .= "</div>\n                  <div class='clearfix'></div>\n                 </div>\n                  <div class='nav-box " . ts_get_animation_class($animation) . "' " . ts_get_animation_data_class($current_animation_delay, $animation_iteration) . ">\n                  <div class='container'>\n                    <a class='prev' href='#'><span class='icon-left'></span></a>\n                    <div class='pagination switches'></div>\n                    <a class='next' href='#'><span class='icon-right'></span></a>  \n                  </div>\n                  </div>\n                </div>\n                <div class='clearfix'></div>";
    return $output;
}
Exemplo n.º 3
0
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function progressive_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    $xv_data = ts_get_redux_data();
    if (ts_check_if_coming_soon_frontend() === false) {
        $layout = '';
        $body_id = '';
        $boxed_page = false;
        if (is_page()) {
            $value = xv_get_field('layout');
            if ($value == 'boxed') {
                $layout = 'boxed hidden-top';
                $body_id = 'boxed-bg';
                $boxed_page = true;
            } else {
                if ($value == 'full') {
                    $layout = 'hidden-top';
                    $boxed_page = true;
                }
            }
        }
        if ($boxed_page === false) {
            if (isset($xv_data['layout']) && $xv_data['layout'] == 'boxed') {
                $layout = 'boxed hidden-top';
                $body_id = 'boxed-bg';
            } else {
                $layout = 'hidden-top';
            }
        }
        $classes[] = $layout;
        if (ts_check_if_display('sticky_menu')) {
            $current_template = get_post_meta(get_the_ID(), '_wp_page_template', true);
            $not_allowed_fixed_header = array('templates/template-under-construction.php');
            if (!in_array($current_template, $not_allowed_fixed_header)) {
                $classes[] = 'fixed-header';
            }
        } else {
            $classes[] = 'top-bar-only';
        }
        if (ts_check_if_display('switch-topbar') && ts_check_if_display('topbar-always-on')) {
            $classes[] = 'topbar-always-on';
            $classes[] = 'visible-top';
        }
        if (!ts_check_if_display('switch-topbar')) {
            $classes[] = 'no-topbar';
        }
    }
    return $classes;
}
Exemplo n.º 4
0
    function progressive_styles()
    {
        ?>
		<style type="text/css">
		<?php 
        if (is_page()) {
            $background_image = xv_get_field('background_image');
            if (is_array($background_image) && !empty($background_image['url'])) {
                ?>
 
					#boxed-bg {
						background-image: url(<?php 
                echo esc_url($background_image['url']);
                ?>
);
					}	
			<?php 
            }
            $footer_up_button_color = xv_get_field('footer_up_button_color');
            $footer_up_button_hover_color = xv_get_field('footer_up_button_hover_color');
            if (!empty($footer_up_button_color)) {
                ?>
 
					#footer .up {
						background-color: <?php 
                echo esc_attr($footer_up_button_color);
                ?>
					}	
			<?php 
            }
            if (!empty($footer_up_button_hover_color)) {
                ?>
 
					#footer .up:hover {
						background-color: <?php 
                echo esc_attr($footer_up_button_hover_color);
                ?>
					}	
			<?php 
            }
        }
        ?>
		</style>
		<?php 
    }
Exemplo n.º 5
0
					<div class="navbar navbar-default" role="navigation">
						<button type="button" class="navbar-toggle btn-navbar collapsed" data-toggle="collapse" data-target=".primary .navbar-collapse">
							<span class="text"><?php 
_e('Menu', 'progressive');
?>
</span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
						</button>            
						<nav class="collapse collapsing navbar-collapse">
							<?php 
$primary_menu = 'main';
$menu = '';
if (is_page()) {
    $menu_slug = xv_get_field('primary_menu');
    if (!empty($menu_slug) && $menu_slug != 'default') {
        $menu = $menu_slug;
    }
}
if (has_nav_menu('main') || !empty($menu)) {
    $args = array('theme_location' => $primary_menu, 'menu' => $menu, 'container' => false, 'menu_class' => 'nav navbar-nav navbar-center', 'fallback_cb' => '', 'menu_id' => 'home-menu', 'depth' => 4, 'walker' => new ts_walker_nav_menu());
    wp_nav_menu($args);
}
?>
						</nav>             
					</div>
				</div><!-- .primary -->			
		</div>
		<div class="col-xs-1 col-md-1 col-lg-1"></div>
	</div><!--.row -->
Exemplo n.º 6
0
        if (has_post_thumbnail()) {
            ?>
					<div class="entry-thumb"><img src="<?php 
            echo esc_url(get_xv_thumbnail(870, 400));
            ?>
" /></div>
				<?php 
        }
        break;
    case 'video':
        $url = xv_get_field('video_url');
        if (!empty($url)) {
            $embadded_video = ts_get_embaded_video($url);
        } else {
            if (empty($url)) {
                $embadded_video = htmlspecialchars_decode(xv_get_field('embedded_video'));
            }
        }
        if ($embadded_video != '') {
            echo wp_kses($embadded_video, ts_add_iframe_to_allowed_tags());
        } else {
            if (has_post_thumbnail()) {
                ?>
					<div class="entry-thumb"><img src="<?php 
                echo esc_url(get_xv_thumbnail(870, 400));
                ?>
" /></div>
				<?php 
            }
        }
        break;
Exemplo n.º 7
0
">
		<h2 class="entry-title">
			<a href="<?php 
echo esc_url(get_the_permalink());
?>
" title="<?php 
echo esc_attr(get_the_title());
?>
"><?php 
the_title();
?>
</a>
		</h2>
		<div class="entry-content">
			<?php 
$audio_url = xv_get_field('audio_url');
if ($audio_url != '') {
    ?>
				<div class="audio-box">
					<audio controls>
						<source type="audio/<?php 
    echo strstr($audio_url, 'ogg') ? 'ogg' : 'mpeg';
    ?>
" src="<?php 
    echo esc_url($audio_url);
    ?>
">
						<?php 
    _e('Your browser does not support the audio element.', 'progressive');
    ?>
					</audio>
Exemplo n.º 8
0
/**
 * Get one of the registered sidebar, depends on Theme options or single post settings
 * Used when sidebar is defined in OptionTree and attached to single post or page using metaboxes
 * Function gets left_sidebar or right_sidebar (these are names of metaboxes not sidebars ids!)
 *
 * @param string sidebar position left or right
 * @param string default default sidebar is not set
 * @return string/bool return string sidebar id or false if sidebar doesn't exists
 *
 * @since framework 1.0
 */
function ts_get_single_post_sidebar_id($position, $default = 'main')
{
    if (function_exists('get_field')) {
        $sidebar = xv_get_field($position);
    } else {
        $sidebar = '';
    }
    if (empty($sidebar) || $sidebar == 'default') {
        $sidebar = $default;
    }
    return $sidebar;
}
Exemplo n.º 9
0
/**
 * Get body id attribute
 * @return string
 */
function ts_get_body_id_attr()
{
    $xv_data = ts_get_redux_data();
    $body_id = '';
    $boxed_page = false;
    if (is_page()) {
        $value = xv_get_field('layout');
        if ($value == 'boxed') {
            $body_id = 'boxed-bg';
        }
    }
    if ($boxed_page === false) {
        if (isset($xv_data['layout']) && $xv_data['layout'] == 'boxed') {
            $body_id = 'boxed-bg';
        }
    }
    if (!empty($body_id)) {
        return 'id="' . $body_id . '"';
    }
    return '';
}
Exemplo n.º 10
0
function ts_person_func($atts)
{
    extract(shortcode_atts(array('animation' => '', 'animation_delay' => '', 'animation_iteration' => '', 'id' => ''), $atts));
    global $post;
    ob_start();
    $new_post = get_post($id);
    if ($new_post && !is_wp_error($new_post)) {
        setup_postdata($new_post);
        ?>
		<div class="bottom-padding">
			<div class="employee employee-single <?php 
        echo ts_get_animation_class($animation);
        ?>
" <?php 
        echo ts_get_animation_data_class($animation_delay, $animation_iteration);
        ?>
>
				<div class="row">
					<div class="images-box col-xs-9 col-sm-6 col-md-4">
						<?php 
        $post_gallery = ts_get_post_opt('post_gallery', $id);
        if (is_array($post_gallery) && count($post_gallery) > 0) {
            ?>
							<div class="carousel-box load" data-carousel-pagination="true" data-carousel-nav="false" data-carousel-one="true">
								<div class="carousel">
									<?php 
            foreach ($post_gallery as $slide) {
                if (!empty($slide['image'])) {
                    $image = theme_thumb($slide['image'], 370, 370);
                }
                if (esc_url($image)) {
                    ?>
											<div class="image">
												<img src="<?php 
                    echo esc_url($image);
                    ?>
" alt="" title="" width="370" height="370">
											</div>
											<?php 
                }
            }
            ?>
								</div>
								<div class="clearfix"></div>
								<div class="pagination switches"></div>
							</div>
						<?php 
        }
        ?>
					</div>
					<div class="employee-description col-sm-8 col-md-8">
						<h3 class="name"><?php 
        echo get_the_title($id);
        ?>
</h3>
						<div class="role"><?php 
        echo xv_get_field('xv_member_designation', $id);
        ?>
</div>
						<div>
							<p><?php 
        echo xv_get_field('xv_member_about', $id);
        ?>
</p>
							<?php 
        $email = xv_get_field('xv_member_email', $id);
        $phone = xv_get_field('xv_member_phone', $id);
        ?>
							<div class="contact"><b><?php 
        _e('Email:', 'progressive');
        ?>
 </b><?php 
        echo wp_kses_data($email);
        ?>
</div>
							<div class="contact"><b><?php 
        _e('Phone:', 'progressive');
        ?>
 </b><?php 
        echo wp_kses_data($phone);
        ?>
</div>
						</div>
						<div class="social">
							<?php 
        $facebook = xv_get_field('xv_member_facebook', $id);
        $twitter = xv_get_field('xv_member_twiiter', $id);
        $gplus = xv_get_field('xv_member_gplus', $id);
        $linkedin = xv_get_field('xv_member_linkedin', $id);
        if (!empty($facebook)) {
            ?>
								<div class="item"><a class="sbtnf sbtnf-rounded color color-hover icon-facebook" href="<?php 
            echo esc_url($facebook);
            ?>
"></a></div>
							<?php 
        }
        if (!empty($twitter)) {
            ?>
								<div class="item"><a class="sbtnf sbtnf-rounded color color-hover icon-twitter" href="<?php 
            echo esc_url($twitter);
            ?>
"></a></div>
							<?php 
        }
        if (!empty($gplus)) {
            ?>
								<div class="item"><a class="sbtnf sbtnf-rounded color color-hover icon-gplus" href="<?php 
            echo esc_url($gplus);
            ?>
"></a></div>
							<?php 
        }
        if (!empty($linkedin)) {
            ?>
								<div class="item"><a class="sbtnf sbtnf-rounded color color-hover icon-linkedin" href="<?php 
            echo esc_url($linkedin);
            ?>
"></a></div>
							<?php 
        }
        ?>
						</div>
					</div>
					<div class="clearfix"></div>
				</div>
			</div><!-- .employee -->
		</div>
		<?php 
        wp_reset_postdata();
    }
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}