Example #1
0
<?php

$media = mtheme_featured_image_link(get_the_id());
$socialshare = array('facebook' => array('icon-facebook' => 'http://www.facebook.com/sharer.php?u=' . get_permalink() . '&t=' . get_the_title()), 'twitter' => array('icon-twitter' => 'http://twitter.com/home?status=' . get_the_title() . '+' . get_permalink()), 'googleplus' => array('icon-google-plus' => 'https://plus.google.com/share?url=' . get_permalink()), 'pinterest' => array('icon-pinterest' => 'http://pinterest.com/pin/create/bookmarklet/?media=' . $media . '&url=' . get_permalink() . '&is_video=false&description=' . get_the_title()), 'link' => array('icon-link' => get_permalink()), 'email' => array('icon-envelope-alt' => 'mailto:email@address.com?subject=Interesting Link&body=' . get_the_title() . " " . get_permalink()));
?>
<ul class="portfolio-share">
<li class="sharethis"><?php 
_e('Share', 'mthemelocal');
?>
</li>
<?php 
foreach ($socialshare as $key => $share) {
    foreach ($share as $icon => $url) {
        echo '<li><a target="_blank" href="' . $url . '"><i class="' . $icon . '"></i></a></li>';
    }
}
?>
</ul>
Example #2
0
function mWorksCarousel($atts, $content = null)
{
    extract(shortcode_atts(array("pageid" => '', "carousel_type" => 'caroufred', "columns" => '4', "limit" => '-1', "title" => 'true', "desc" => 'true', "boxtitle" => 'true', "worktype_slug" => '', "pagination" => 'false'), $atts));
    $uniqureID = get_the_id() . "-" . dechex(mt_rand(1, 65535));
    $column_type = "four";
    $portfolioImage_type = "gridblock-large";
    if ($columns == 4) {
        $column_type = "four";
        $portfolioImage_type = "gridblock-large";
    }
    if ($columns == 3) {
        $column_type = "three";
        $portfolioImage_type = "gridblock-large";
    }
    if ($columns == 2) {
        $column_type = "three";
        $portfolioImage_type = "gridblock-large";
    }
    if ($worktype_slug == "-1") {
        $worktype_slug = '';
    }
    $portfolio_count = 0;
    $flag_new_row = true;
    $portfoliogrid = '';
    if ($carousel_type == "caroufred") {
        // Going to be obsolete
        $portfoliogrid .= '<div class="gridblock-carousel-wrap clearfix">';
        $portfoliogrid .= '<ul class="carousel-catcher" id="carousel-items-' . $uniqureID . '">';
        if (get_query_var('paged')) {
            $paged = get_query_var('paged');
        } elseif (get_query_var('page')) {
            $paged = get_query_var('page');
        } else {
            $paged = 1;
        }
        query_posts(array('post_type' => 'mtheme_portfolio', 'orderby' => 'menu_order', 'order' => 'ASC', 'types' => $worktype_slug, 'paged' => $paged, 'posts_per_page' => $limit));
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                //echo $type, $portfolio_type;
                $custom = get_post_custom(get_the_ID());
                $portfolio_cats = get_the_terms(get_the_ID(), 'types');
                $lightboxvideo = "";
                $thumbnail = "";
                $customlink_URL = "";
                $portfolio_thumb_header = "Image";
                if (isset($custom[MTHEME . '_thumbnail_linktype'][0])) {
                    $portfolio_link_type = $custom[MTHEME . '_thumbnail_linktype'][0];
                }
                if (isset($custom[MTHEME . '_lightbox_video'][0])) {
                    $lightboxvideo = $custom[MTHEME . '_lightbox_video'][0];
                }
                if (isset($custom[MTHEME . '_customthumbnail'][0])) {
                    $thumbnail = $custom[MTHEME . '_customthumbnail'][0];
                }
                if (isset($custom[MTHEME . '_thumbnail_desc'][0])) {
                    $description = $custom[MTHEME . '_thumbnail_desc'][0];
                }
                if (isset($custom[MTHEME . '_customlink'][0])) {
                    $customlink_URL = $custom[MTHEME . '_customlink'][0];
                }
                if (isset($custom[MTHEME . '_portfoliotype'][0])) {
                    $portfolio_thumb_header = $custom[MTHEME . '_portfoliotype'][0];
                }
                if ($portfolio_count == $columns) {
                    $portfolio_count = 0;
                }
                $protected = "";
                $icon_class = "column-gridblock-icon";
                $portfolio_count++;
                $portfoliogrid .= '<li class="gridblock-grid-element">';
                if ($boxtitle == "true") {
                    $portfoliogrid .= '<span class="boxtitle-hover"><a href="' . get_permalink() . '" rel="bookmark" title="' . get_the_title() . '">' . get_the_title() . '</a></span>';
                }
                $portfoliogrid .= '<span class="gridblock-link-hover">';
                $linkcenter = '';
                if ($portfolio_link_type == "DirectURL") {
                    $linkcenter = "gridblock-link-center";
                }
                $portfoliogrid .= '<a href="' . get_permalink() . '"><span class="hover-icon-effect column-gridblock-link ' . $linkcenter . '"><i class="icon-plus"></i></span></a>';
                $portfoliogrid .= '</span>';
                //if Password Required
                if (post_password_required()) {
                    $protected = " gridblock-protected";
                    $iconclass = "";
                    $portfoliogrid .= '<a class="' . $protected . ' gridblock-image-link gridblock-columns" title="' . get_the_title() . '" href="' . get_permalink() . '" >';
                    $portfoliogrid .= '<span class="grid-blank-status"><i class="icon-lock icon-2x"></i></span>';
                    $portfoliogrid .= '<div class="gridblock-protected"><img src="' . MTHEME_PATH . '/images/icons/blank-grid.png" /></div>';
                } else {
                    //Switch check for Linked Type
                    switch ($portfolio_link_type) {
                        case 'DirectURL':
                            $portfoliogrid .= '<a class="gridblock-image-link gridblock-columns" href="' . get_permalink() . '" rel="bookmark" title="' . get_the_title() . '">';
                            $icon_class = "";
                            break;
                        case 'Customlink':
                            $portfoliogrid .= '<a class="gridblock-image-link gridblock-columns" href="' . $customlink_URL . '">';
                            $icon_class = '<i class="icon-external-link"></i>';
                            break;
                        case 'Lightbox':
                            if ($lightboxvideo != "") {
                                $portfoliogrid .= mtheme_activate_lightbox($lightbox_type = "prettyPhoto", $ID = get_the_ID(), $link = $lightboxvideo, $mediatype = "video", $imagetitle = get_the_title(), $class = "gridblock-image-link gridblock-columns", $navigation = "prettyPhoto[portfolio]");
                                $icon_class = '<i class="icon-play"></i>';
                            } else {
                                $portfoliogrid .= mtheme_activate_lightbox($lightbox_type = "prettyPhoto", $ID = get_the_ID(), $link = mtheme_featured_image_link(get_the_ID()), $mediatype = "image", $imagetitle = mtheme_featured_image_title(get_the_ID()), $class = "gridblock-image-link gridblock-columns", $navigation = "prettyPhoto[portfolio]");
                                $icon_class = '<i class="icon-search"></i>';
                            }
                            break;
                    }
                    // Display Hover icon trigger classes
                    $portfoliogrid .= '<span class="gridblock-image-hover">';
                    if ($icon_class) {
                        $portfoliogrid .= '<span class="hover-icon-effect column-gridblock-icon">' . $icon_class . '</span>';
                    }
                    $portfoliogrid .= '</span>';
                    // If it aint slideshow then display a background. Otherwise one is active in slideshow thumbnails.
                    // Custom Thumbnail
                    $portfoliogrid .= '<span class="gridblock-background-hover"></span>';
                    if ($thumbnail != "") {
                        $portfoliogrid .= '<img src="' . $thumbnail . '" class="preload-image displayed-image" alt="thumbnail" />';
                    } else {
                        // Slideshow then generate slideshow shortcode
                        $portfoliogrid .= mtheme_display_post_image(get_the_ID(), $have_image_url = "", $link = false, $type = $portfolioImage_type, $imagetitle = mtheme_featured_image_title(get_the_ID()), $class = "preload-image displayed-image");
                    }
                }
                $portfoliogrid .= '</a>';
                $portfoliogrid .= '</li>';
            }
        }
        $portfoliogrid .= '</ul>';
        $portfoliogrid .= '<a class="prev" id="carousel-previous-' . $uniqureID . '" href="#"><i class="icon-chevron-left"></i></a>';
        $portfoliogrid .= '<a class="next" id="carousel-next-' . $uniqureID . '" href="#"><i class="icon-chevron-right"></i></a>';
        $portfoliogrid .= '</div>';
        $portfoliogrid .= '
	<script>
	/* <![CDATA[ */
	(function($){
	$(window).load(function(){
	    jQuery("#carousel-items-' . $uniqureID . '").carouFredSel({
		responsive: true,
		auto: false,
		items: {
			width: 350,
			height: "auto",
			visible: {
				min: 1,
				max: 4
			}
		},
		swipe		: {
			onTouch		: true,
			onMouse		: true,
			items		: 3
		},
		prev	: {	
			button	: "#carousel-previous-' . $uniqureID . '",
			key		: "left"
		},
		next	: { 
			button	: "#carousel-next-' . $uniqureID . '",
			key		: "right"
		}
		});
		jQuery("#carousel-items-' . $uniqureID . '").swipe({
		  excludedElements: "button, input, select, textarea, .noSwipe",
		  swipeLeft: function() {
		    jQuery("#carousel-next-' . $uniqureID . '").trigger("click");
		  },
		  swipeRight: function() {
		    jQuery("#carousel-previous-' . $uniqureID . '").trigger("click");
		  }
		});
		jQuery(".gridblock-carousel-wrap").css({"visibility":"visible","height":"auto","overflow":"visible"});;
	})
	})(jQuery);
	/* ]]> */
	</script>
	';
    }
    if ($carousel_type == "owl") {
        $portfoliogrid .= '<div class="gridblock-owlcarousel-wrap clearfix">';
        $portfoliogrid .= '<div id="owl-' . $uniqureID . '" class="owl-carousel">';
        if (get_query_var('paged')) {
            $paged = get_query_var('paged');
        } elseif (get_query_var('page')) {
            $paged = get_query_var('page');
        } else {
            $paged = 1;
        }
        query_posts(array('post_type' => 'mtheme_portfolio', 'orderby' => 'menu_order', 'order' => 'ASC', 'types' => $worktype_slug, 'paged' => $paged, 'posts_per_page' => $limit));
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                //echo $type, $portfolio_type;
                $custom = get_post_custom(get_the_ID());
                $portfolio_cats = get_the_terms(get_the_ID(), 'types');
                $lightboxvideo = "";
                $thumbnail = "";
                $customlink_URL = "";
                $portfolio_thumb_header = "Image";
                if (isset($custom[MTHEME . '_thumbnail_linktype'][0])) {
                    $portfolio_link_type = $custom[MTHEME . '_thumbnail_linktype'][0];
                }
                if (isset($custom[MTHEME . '_lightbox_video'][0])) {
                    $lightboxvideo = $custom[MTHEME . '_lightbox_video'][0];
                }
                if (isset($custom[MTHEME . '_customthumbnail'][0])) {
                    $thumbnail = $custom[MTHEME . '_customthumbnail'][0];
                }
                if (isset($custom[MTHEME . '_thumbnail_desc'][0])) {
                    $description = $custom[MTHEME . '_thumbnail_desc'][0];
                }
                if (isset($custom[MTHEME . '_customlink'][0])) {
                    $customlink_URL = $custom[MTHEME . '_customlink'][0];
                }
                if (isset($custom[MTHEME . '_portfoliotype'][0])) {
                    $portfolio_thumb_header = $custom[MTHEME . '_portfoliotype'][0];
                }
                if ($portfolio_count == $columns) {
                    $portfolio_count = 0;
                }
                $protected = "";
                $icon_class = "column-gridblock-icon";
                $portfolio_count++;
                $portfoliogrid .= '<div class="gridblock-grid-element">';
                if ($boxtitle == "true") {
                    $portfoliogrid .= '<span class="boxtitle-hover"><a href="' . get_permalink() . '" rel="bookmark" title="' . get_the_title() . '">' . get_the_title() . '</a></span>';
                }
                $portfoliogrid .= '<span class="gridblock-link-hover">';
                $linkcenter = '';
                if ($portfolio_link_type == "DirectURL") {
                    $linkcenter = "gridblock-link-center";
                }
                $portfoliogrid .= '<a href="' . get_permalink() . '"><span class="hover-icon-effect column-gridblock-link ' . $linkcenter . '"><i class="icon-plus"></i></span></a>';
                $portfoliogrid .= '</span>';
                //if Password Required
                if (post_password_required()) {
                    $protected = " gridblock-protected";
                    $iconclass = "";
                    $portfoliogrid .= '<a class="' . $protected . ' gridblock-image-link gridblock-columns" title="' . get_the_title() . '" href="' . get_permalink() . '" >';
                    $portfoliogrid .= '<span class="grid-blank-status"><i class="icon-lock icon-2x"></i></span>';
                    $portfoliogrid .= '<div class="gridblock-protected"><img src="' . MTHEME_PATH . '/images/icons/blank-grid.png" /></div>';
                } else {
                    //Switch check for Linked Type
                    switch ($portfolio_link_type) {
                        case 'DirectURL':
                            $portfoliogrid .= '<a class="gridblock-image-link gridblock-columns" href="' . get_permalink() . '" rel="bookmark" title="' . get_the_title() . '">';
                            $icon_class = "";
                            break;
                        case 'Customlink':
                            $portfoliogrid .= '<a class="gridblock-image-link gridblock-columns" href="' . $customlink_URL . '">';
                            $icon_class = '<i class="icon-external-link"></i>';
                            break;
                        case 'Lightbox':
                            if ($lightboxvideo != "") {
                                $portfoliogrid .= mtheme_activate_lightbox($lightbox_type = "prettyPhoto", $ID = get_the_ID(), $link = $lightboxvideo, $mediatype = "video", $imagetitle = get_the_title(), $class = "gridblock-image-link gridblock-columns", $navigation = "prettyPhoto[portfolio]");
                                $icon_class = '<i class="icon-play"></i>';
                            } else {
                                $portfoliogrid .= mtheme_activate_lightbox($lightbox_type = "prettyPhoto", $ID = get_the_ID(), $link = mtheme_featured_image_link(get_the_ID()), $mediatype = "image", $imagetitle = mtheme_featured_image_title(get_the_ID()), $class = "gridblock-image-link gridblock-columns", $navigation = "prettyPhoto[portfolio]");
                                $icon_class = '<i class="icon-search"></i>';
                            }
                            break;
                    }
                    // Display Hover icon trigger classes
                    $portfoliogrid .= '<span class="gridblock-image-hover">';
                    if ($icon_class) {
                        $portfoliogrid .= '<span class="hover-icon-effect column-gridblock-icon">' . $icon_class . '</span>';
                    }
                    $portfoliogrid .= '</span>';
                    // If it aint slideshow then display a background. Otherwise one is active in slideshow thumbnails.
                    // Custom Thumbnail
                    $portfoliogrid .= '<span class="gridblock-background-hover"></span>';
                    if ($thumbnail != "") {
                        $portfoliogrid .= '<img src="' . $thumbnail . '" class="preload-image displayed-image" alt="thumbnail" />';
                    } else {
                        // Slideshow then generate slideshow shortcode
                        $portfoliogrid .= mtheme_display_post_image(get_the_ID(), $have_image_url = "", $link = false, $type = $portfolioImage_type, $imagetitle = mtheme_featured_image_title(get_the_ID()), $class = "preload-image displayed-image");
                    }
                }
                $portfoliogrid .= '</a>';
                $portfoliogrid .= '</div>';
            }
        }
        $portfoliogrid .= '</div>';
        $portfoliogrid .= '</div>';
        $portfoliogrid .= '
	<script>
	/* <![CDATA[ */
	(function($){
	$(window).load(function(){
		$("#owl-' . $uniqureID . '").owlCarousel({
			itemsCustom : [
				[0, 1],
				[500, 2],
				[700, 3],
				[1024, ' . $columns . ']
			],
			items: ' . $columns . ',
			navigation : true,
			navigationText : ["",""],
			scrollPerPage : false
		});
	})
	})(jQuery);
	/* ]]> */
	</script>
	';
    }
    wp_reset_query();
    return $portfoliogrid;
}
<?php

if (isset($post->ID)) {
    $bg_choice = get_post_meta($post->ID, MTHEME . '_meta_background_choice', true);
    $custom_bg_image_url = get_post_meta($post->ID, MTHEME . '_meta_background_url', true);
    $image_link = mtheme_featured_image_link($post->ID);
}
// For Debug
// print_r($bg_choice . " " .  $post->ID . " " . $image_link );
$default_bg = of_get_option('general_background_image');
// Theme Options set image
$theme_options_set_background_slideshow = of_get_option('general_bgslideshow');
$photowall_background_image = of_get_option('photowall_background_image');
if (!isset($bg_choice)) {
    $bg_choice = "options_image";
}
// Check custom posts
function mtheme_generate_bg_script($the_image)
{
    global $mtheme_bg_image_script;
    if ($the_image) {
        $mtheme_bg_image_script = '<script>/* <![CDATA[ */';
        $mtheme_bg_image_script .= 'jQuery(document).ready(function($){';
        $mtheme_bg_image_script .= 'if ($.fn.backstretch) {';
        $mtheme_bg_image_script .= '$.backstretch("' . $the_image . '", {  speed: 1000	});';
        $mtheme_bg_image_script .= '}';
        $mtheme_bg_image_script .= '})';
        $mtheme_bg_image_script .= '/* ]]> */</script>';
    }
}
if (isset($fullscreen_slideshowpost)) {
Example #4
0
/**
 * Portfolio Slideshow .
 *
 * @ [flexislideshow link=(lightbox,direct,none)]
 */
function mtheme_PortfolioSlideshow($atts, $content = null)
{
    extract(shortcode_atts(array("limit" => '-1', "worktype_slugs" => '', "transition" => 'fade'), $atts));
    //echo $type, $portfolio_type;
    $countquery = array('post_type' => 'mtheme_portfolio', 'orderby' => 'menu_order', 'order' => 'ASC', 'types' => $worktype_slugs, 'posts_per_page' => $limit);
    query_posts($countquery);
    $flexID = "ID" . dechex(time()) . dechex(mt_rand(1, 65535));
    $uniqurePageID = get_the_id() . "-" . dechex(mt_rand(1, 65535));
    $portfolioImage_type = "blog-full";
    $output = '
	<div class="spaced-wrap clearfix">
		<div class="flexslider-container-page flexislider-container-' . $flexID . ' clearfix">
			<div id="flex' . $flexID . '" class="flexslider">
			<ul class="slides">';
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            if (has_post_thumbnail()) {
                $output .= '<li class="slideshow-box-wrapper">';
                $output .= '<div class="slideshow-box-image">';
                $lightbox_image = mtheme_featured_image_link(get_the_id());
                $lightbox_media = $lightbox_image;
                $custom = get_post_custom(get_the_ID());
                if (isset($custom[MTHEME . '_lightbox_video'][0])) {
                    $lightbox_media = $custom[MTHEME . '_lightbox_video'][0];
                }
                $output .= '<a class="gridblock-image-link flexislideshow-link"' . ' title="' . get_the_title() . '" rel="prettyPhoto[' . $uniqurePageID . ']" href="' . $lightbox_media . '">';
                $output .= mtheme_display_post_image(get_the_ID(), $have_image_url = "", $link = false, $theimage_type = $portfolioImage_type, $imagetitle = '', $class = "preload-image displayed-image");
                $output .= '</a>';
                $output .= '</div>';
                $output .= '<div class="slideshow-box-content"><div class="slideshow-box-content-inner">';
                $output .= '<div class="slideshow-box-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></div>';
                $output .= '<div class="slideshow-box-info">';
                $output .= '<div class="slideshow-box-categories">';
                $categories = get_the_term_list(get_the_id(), 'types', '', ' / ', '');
                $output .= '<span>' . $categories . '</span>';
                $output .= '</div>';
                $output .= '</div>';
                $output .= '</div></div>';
                $output .= '</li>';
            }
        }
    }
    $output .= '</ul></div></div><div class="clear"></div></div>';
    $output .= '
<script type="text/javascript">
	jQuery(window).load(function() {
		jQuery("#flex' . $flexID . '").flexslider({
			animation: "' . $transition . '",
			slideshow: true,
			pauseOnAction: true,
			pauseOnHover: true,
			smoothHeight: true,
			controlsContainer: "flexslider-container-' . $flexID . '",
			start: function(){
				jQuery(".flexslider-container-page,.gridblock-element .ajax-image-block").css("background","none");
			},
		});
	});
</script>
';
    wp_reset_query();
    return $output;
}
Example #5
0
        ?>
', wrapperZIndex: -1, start: 0, mute: false, repeat: false, ratio: 16/9 };
	$('#backgroundvideo').tubular(options);
});
</script>
<?php 
    }
    ?>
<style type='text/css'>
body { overflow:hidden; }
</style>
<?php 
    //If iOS then display a play button in Youtube video page.
    if (mtheme_get_device() == "ios" && $youtube != false) {
        if (has_post_thumbnail()) {
            $default_bg = mtheme_featured_image_link($featured_page);
            ?>
			<script type="text/javascript">
			/* <![CDATA[ */
			jQuery(document).ready(function(){
			<?php 
            echo '
					jQuery.backstretch("' . $default_bg . '", {
						speed: 1000
					});
					';
            ?>
			});
			/* ]]> */
			</script>
		 <?php