function ts_teaser_2_func($atts, $content = null) { extract(shortcode_atts(array("image" => '', "title" => '', "button" => '', "url" => '', "target" => '_self'), $atts)); $button_html = ''; if (!empty($url)) { $button_html = '<a href="' . $url . '" target="' . $target . '" class="sc-button grey-grad">' . $button . '</a>'; } $html = ' <div class="widget_testimonials-container clearfix"> <article class="item"> <header> <h2>' . $title . '</h2> </header> <div class="item-helper"> <div class="avatar big"> ' . ts_get_resized_image_by_size($image, 'teaser_2') . ' </div> </div> <div class="item-body"> ' . $content . ' ' . $button_html . ' </div> </article> </div>'; return $html; }
function ts_promo_func($atts, $content = null) { extract(shortcode_atts(array("header" => '', 'content' => '', 'url' => '', 'target' => '', 'image' => ''), $atts)); $image_tag = ''; if (!empty($image)) { $image_tag = ts_get_resized_image_by_size($image, 'promo', $header, 'img_grayscale'); } $content = "\n\t\t<div class='widget_out_stuff2 clearfix'>\n\t\t\t<article class='item-con-t1 blue-on-hover'>\n\t\t\t\t<div class='container-t1'>\n\t\t\t\t\t<div class='container-t1-margin'>\n\t\t\t\t\t\t<header>\n\t\t\t\t\t\t<div class='overlay tran03slinear'></div>\n\t\t\t\t\t\t\t<div class='bg-black-045 tran03slinear'></div>\n\t\t\t\t\t\t\t<h2>" . $header . "</h2>\n\t\t\t\t\t\t\t<p>" . $content . "</p>\n\t\t\t\t\t\t</header>\n\t\t\t\t\t\t" . $image_tag . "\n\t\t\t\t\t\t<div class='facilities'>\n\t\t\t\t\t\t\t<div class='image-links'>\n\t\t\t\t\t\t\t\t<a rel='' title='" . $header . "' href='" . $url . "' target='" . $target . "'><span class='add'></span></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='blue-line visible-on-hover tran03slinear'></div>\n\t\t\t</article>\n\t\t</div>"; return $content; }
<div class='container-t1'> <div class='container-t1-margin'> <?php if (get_post_format() == 'video') { $url = get_post_meta($post->ID, 'video_url', true); if (!empty($url)) { $embadded_video = ts_get_embaded_video($url); } elseif (empty($url)) { $embadded_video = get_post_meta($post->ID, 'embedded_video', true); } } elseif (get_post_format() == 'gallery') { $gallery = get_post_meta($post->ID, 'gallery_images', true); $gallery_html = ''; if (is_array($gallery)) { foreach ($gallery as $image) { $gallery_html .= '<li>' . ts_get_resized_image_by_size($image['image'], 'portfolio-single', $image['title']) . '</li>'; } } } ?> <?php if (!isset($embadded_video)) { ?> <header> <div class='bg-black-045'></div> <h2><?php the_title(); ?> </h2> <h3><?php echo $categories;
/** * Get resized image, checks for sidebars and choose best resolution * @global type $post * @param string $image image url, must be from media library * @param array $sizes array of 3 sizes, 0 - no sidebars, 1 - one siedebar, 2 - two siedbars, eg. array('600,300','400,200','300,150') * @param string $alt * @param string $class * @param string $title * @return string * @since framework 1.0 */ function ts_get_resized_image_sidebar($image, $sizes, $alt = '', $class = '', $title = '') { if (ts_check_if_two_sidebars()) { $size = 2; } else { if (ts_check_if_sidebar()) { $size = 1; } else { $size = 0; } } return ts_get_resized_image_by_size($image, $sizes[$size], $alt, $class, false, $title); }
function ts_flexslider_func($atts, $content = null) { extract(shortcode_atts(array("id" => ""), $atts)); if (!(int) $id) { return ''; } require_once get_template_directory() . '/framework/class/FlexSliderSlider.class.php'; require_once get_template_directory() . '/framework/class/FlexSliderSlide.class.php'; $oSlider = new FlexSliderSlider($id); $oRecord = $oSlider->get(); if ($oRecord === false) { return ''; } $oSlides = new FlexSliderSlide(); $aSlides = $oSlides->getSliderSlides($id); if (is_array($aSlides) && count($aSlides) > 0) { require_once get_template_directory() . '/framework/class/freshizer.php'; foreach ($aSlides as $oSlide) { $image = ts_get_resized_image_by_size($oSlide->image, 'slider'); $content .= '<li>' . $image . '</li>'; } } $rand = $id . '-' . rand(1, 5000); $animation = 'slide'; if (in_array($oRecord->animation, array('slide', 'fade'))) { $animation = $oRecord->animation; } $direction = 'horizontal'; if (in_array($oRecord->direction, array('horizontal', 'vertical'))) { $direction = $oRecord->direction; } $slideshow_speed = 100; if ((int) $oRecord->slideshow_speed > 100) { $slideshow_speed = $oRecord->slideshow_speed; } $animation_speed = 100; if ((int) $oRecord->animation_speed > 100) { $animation_speed = $oRecord->animation_speed; } $reverse = false; if ((int) $oRecord->reverse == 1) { $reverse = true; } $randomize = false; if ((int) $oRecord->randomize == 1) { $randomize = true; } $controlNav = true; if ((int) $oRecord->control_nav == 0) { $controlNav = false; } $directionNav = true; if ((int) $oRecord->direction_nav == 0) { $directionNav = false; } $before = ""; $after = ""; if (!empty($oRecord->background)) { $before = "<div class='slider-background' style='background: url(" . $oRecord->background . ");'>"; $after = "</div>"; } $content = $before . "\n\t\t<div class='flexslider images-slider' id='flexslider-" . $rand . "'>\n\t\t\t<ul class='slides'>" . do_shortcode(shortcode_unautop($content)) . "</ul>\n\t\t</div>" . $after; $content .= "\n\t\t<script type='text/javascript'>\n\t\t\tjQuery(document).ready(function() {\n\t\t\t jQuery('#flexslider-" . $rand . "').flexslider({\n\t\t\t\tanimation: '" . $animation . "',\n\t\t\t\tdirection: '" . $direction . "',\n\t\t\t\tslideshowSpeed: " . $slideshow_speed . ",\n\t\t\t\tanimationSpeed: " . $animation_speed . ",\n\t\t\t\tcontrolNav: " . (int) $controlNav . ",\n\t\t\t\tdirectionNav: " . (int) $directionNav . ",\n\t\t\t\treverse: " . (int) $reverse . ",\n\t\t\t\trandomize: " . (int) $randomize . ",\n\t\t\t\tprevText: \"" . ts_get_prev_slider_text() . "\",\n\t\t\t\tnextText: \"" . ts_get_next_slider_text() . "\"\n\t\t\t });\n\t\t\t});\n\t\t</script>"; // Restor original Query & Post Data wp_reset_query(); wp_reset_postdata(); return $content; }
function ts_teaser_func($atts, $content = null) { extract(shortcode_atts(array("style" => '1', "image" => '', "icon" => '', "title" => '', "subtitle" => '', "url" => '', "target" => '_self'), $atts)); $url_1 = ''; $url_2 = ''; if (!empty($url)) { $url_1 = '<a href="' . $url . '" target="' . $target . '">'; $url_2 = '</a>'; } switch ($style) { case '1': return ' <article class="teaser style1"> <div> ' . ts_get_resized_image_by_size($image, 'teaser') . ' ' . $url_1 . ' <header class="teaser-hover blue-grad"> <h2>' . $title . '</h2> <h3>' . $subtitle . '</h3> </header> ' . $url_2 . ' </div> </article> '; break; case '2': return ' <article class="teaser style2"> <div> ' . ts_get_resized_image_by_size($image, 'teaser') . ' <header class="teaser-hover"> <h2>' . $title . '</h2> <h3>' . $subtitle . '</h3> <div>' . $url_1 . '<span>+</span>' . $url_2 . '</div> </header> </div> </article>'; break; case '3': return ' <article class="teaser style3 small"> ' . $url_1 . ' <div> ' . ts_get_resized_image_by_size($image, 'teaser-small') . ' <div class="bg-black-045"></div> <div class="teaser-bg teaser-hover blue-grad"></div> </div> <header> ' . (!empty($icon) ? '<img src="' . get_template_directory_uri() . '/img/' . $icon . '">' : '') . ' <h2>' . $title . '</h2> </header> ' . $url_2 . ' </article>'; break; case '4': return ' <article class="teaser style4 small"> <div> ' . ts_get_resized_image_by_size($image, 'teaser-small') . ' <a class="teaser-icon" href="' . $url . '" target="' . $target . '"> <div class="advantages-img img-1"> <span></span> <span class="tran03slinear"></span> ' . (!empty($icon) ? '<img src="' . get_template_directory_uri() . '/img/' . $icon . '">' : '') . ' </div> </a> </div> <header> <h2>' . $title . '</h2> </header> </article>'; case '5': return ' <div class="widget_out_stuff-container clearfix"> <article class="item-con-t1 tran03slinear"> ' . $url_1 . ' <div class="container-t1"> <header class="tran03slinear"> <img src="' . get_template_directory_uri() . '/img/member-bg.png" alt=""> <h2>' . $title . '</h2> <h3>' . $subtitle . '</h3> </header> ' . ts_get_resized_image_by_size($image, 'teaser-small') . ' </div> ' . $url_2 . ' <span class="corner tran03slinear"></span> </article> </div>'; break; } }
function ts_latest_posts_func($atts, $content = null) { extract(shortcode_atts(array("header" => '', "limit" => 10), $atts)); if (!(int) $limit) { $limit = 10; } $rand = rand(1, 1000); global $query_string, $post; $args = array('posts_per_page' => $limit, 'offset' => 0, 'cat' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'paged' => 1, 'post_status' => 'publish'); $the_query = new WP_Query($args); $content = ''; $rand = rand(1, 1000); if ($the_query->have_posts()) { $embadded_video = ''; $galleries = array(); $list = ''; while ($the_query->have_posts()) { $the_query->the_post(); $media = ''; $embadded_video = ''; $show_overlay = true; if (get_post_format($post->ID) == 'video') { $url = get_post_meta($post->ID, 'video_url', true); if (!empty($url)) { $embadded_video = ts_get_embaded_video($url); } else { if (empty($url)) { $embadded_video = get_post_meta($post->ID, 'embedded_video', true); } } } if (!empty($embadded_video)) { $media = '<div class="post-img post-video">'; $media .= '<div class="videoWrapper">'; $media .= $embadded_video; $media .= '</div>'; $media .= '</div>'; $media .= '<div class="clear"></div>'; $show_overlay = false; } else { if (get_post_format($post->ID) == 'gallery') { $gallery = get_post_meta($post->ID, 'gallery_images', true); if (is_array($gallery) && count($gallery) > 0) { $rand2 = rand(1, 1000); $media = '<div class="flexslider fs-inner latest-posts-gallery" id="flexslider-latest-posts-gallery-' . $post->ID . '-' . $rand2 . '">'; $media .= '<ul class="slides-inner">'; foreach ($gallery as $image) { $media .= '<li>' . ts_get_resized_image_by_size($image['image'], 'latest-posts', $image['title']) . '</li>'; } $media .= '</ul>'; $media .= '</div>'; $galleries[] = $post->ID . '-' . $rand2; $show_overlay = false; } else { $media = ts_get_resized_post_thumbnail($post->ID, 'latest-posts', get_the_title($post->ID)); } } else { if (has_post_thumbnail()) { $media = ts_get_resized_post_thumbnail($post->ID, 'latest-posts', get_the_title($post->ID)); } } } $comments = get_comments_number(); $list .= "\n\t\t\t\t<li>\n\t\t\t\t\t<article class='item'>"; if (!empty($media)) { $list .= "\n\t\t\t\t\t\t<div class='item-con-t1'>\n\t\t\t\t\t\t\t<div class='container-t1'>\n\t\t\t\t\t\t\t\t<div class='container-t1-margin'>\n\t\t\t\t\t\t\t\t\t" . ($show_overlay === true ? "\n\t\t\t\t\t\t\t\t\t\t<footer class='visible-on-hover'>\n\t\t\t\t\t\t\t\t\t\t\t<div class='bg-black-045'></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class='widget_recent_posts_2-fac'>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class='date'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span>" . get_the_time(get_option('date_format')) . "</span>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class='category'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . get_the_category_list(', ', '', $post->ID) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</footer>\n\t\t\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t\t\t" . $media . "\n\t\t\t\t\t\t\t\t\t" . ($show_overlay === true ? "\n\t\t\t\t\t\t\t\t\t\t<div class='facilities visible-on-hover'>\n\t\t\t\t\t\t\t\t\t\t\t<div class='bg-black-020'></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class='image-links'>\n\t\t\t\t\t\t\t\t\t\t\t\t<a rel='' title='" . esc_attr(get_the_title()) . "' href='" . get_permalink() . "'><span class='add'></span></a>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='blue-line visible-on-hover tran03slinear'></div>\n\t\t\t\t\t\t</div>"; } $list .= "\n\t\t\t\t\t\t<div class='item-body'>\n\t\t\t\t\t\t\t<div class='item-helper'>\n\t\t\t\t\t\t\t\t<div class='avatar big'>\n\t\t\t\t\t\t\t\t\t" . get_avatar($post->post_author, 71) . "\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='post-comments'>\n\t\t\t\t\t\t\t\t\t<span>" . $comments . "</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='post-author'>\n\t\t\t\t\t\t\t\t\tBy\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t" . get_the_author_link() . "\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<header>\n\t\t\t\t\t\t\t\t<a href='" . get_permalink() . "'><h2>" . get_the_title() . "</h2></a>\n\t\t\t\t\t\t\t\t<p>" . get_post_meta($post->ID)['_aioseop_description'][0] . "</p>\n\t\t\t\t\t\t\t</header>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</article>\n\t\t\t\t</li>"; } $content = "\n\t\t\t<section class='widget widget_recent_posts_2'>\n\t\t\t\t<div class='grid_12'>\n\t\t\t\t<h2 class='title'>" . $header . "</h2>\n\t\t\t\t<div class='separator'>\n\t\t\t\t\t<div></div>\n\t\t\t\t</div>\n\t\t\t\t<div class='pagination'>\n\t\t\t\t\t<span id='flexslider-latest-posts-prev-" . $rand . "' class='prev-t1'></span>\n\t\t\t\t\t<span id='flexslider-latest-posts-next-" . $rand . "' class='next-t1'></span>\n\t\t\t\t</div>\n\t\t\t\t\t<div id='flexslider-latest-posts-" . $rand . "' class='flexslider widget_recent_posts_2-container clearfix'>\n\t\t\t\t\t\t<ul class='slides'>" . $list . "</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\tjQuery('#flexslider-latest-posts-" . $rand . "').flexslider({\n\t\t\t\t\t\tanimation: 'slide',\n\t\t\t\t\t\tanimationLoop: true,\n\t\t\t\t\t\titemWidth: 320,\n\t\t\t\t\t\titemMargin: 0,\n\t\t\t\t\t\tslideshow: false,\n\t\t\t\t\t\tcontrolNav: false,\n\t\t\t\t\t\tdirectionNav: false,\n\t\t\t\t\t\tminItems: 3,\n\t\t\t\t\t\tmaxItems: 3,\n\t\t\t\t\t\tmove: 1\n\t\t\t\t\t});\n\n\t\t\t\t\tjQuery('#flexslider-latest-posts-prev-" . $rand . "').click(function(){\n\t\t\t\t\t\tjQuery('#flexslider-latest-posts-" . $rand . "').flexslider('prev');\n\t\t\t\t\t});\n\n\t\t\t\t\tjQuery('#flexslider-latest-posts-next-" . $rand . "').click(function(){\n\t\t\t\t\t\tjQuery('#flexslider-latest-posts-" . $rand . "').flexslider('next');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>"; if (is_array($galleries) && count($galleries) > 0) { foreach ($galleries as $gallery) { $content .= ' <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#flexslider-latest-posts-gallery-' . $gallery . '").flexslider({ selector: ".slides-inner > li", animation: "slide", animationLoop: true, controlNav: false, slideshowSpeed: 3000, prevText: "' . ts_get_prev_slider_text() . '", nextText: "' . ts_get_next_slider_text() . '" }); }); </script>'; } } } // Restor original Query & Post Data wp_reset_query(); wp_reset_postdata(); return $content; }