Example #1
0
}
if (!$slideshow_vertical_center) {
    $slideshow_vertical_center = 0;
}
if (!$slideshow_horizontal_center) {
    $slideshow_horizontal_center = 0;
}
$supersized_image_path = get_template_directory_uri() . '/images/supersized/';
$slideshow_thumbnails = "";
$featured_linked = false;
$attatchmentURL = "";
$postLink = "";
$thelimit = -1;
$count = 0;
// Grab all image attachements from the featured page
$filter_image_ids = mtheme_get_custom_attachments($get_slideshow_from_page_id);
if ($filter_image_ids) {
    ob_start();
    ?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(function($){
	jQuery.supersized({
		slideshow               :   1,
		autoplay				:	1,
		start_slide             :   1,
		image_path				:	'<?php 
    echo $supersized_image_path;
    ?>
',
		stop_loop				:	<?php 
Example #2
0
    ?>
                </div>
            </div>
        </div>
    </div>
    <?php 
} else {
    if (defined('ICL_LANGUAGE_CODE')) {
        // this is to not break code in case WPML is turned off, etc.
        $_type = get_post_type($featured_page);
        $featured_page = icl_object_id($featured_page, $_type, true, ICL_LANGUAGE_CODE);
    }
    // Don't Populate list if no Featured page is set
    //The Image IDs
    if ($featured_page != "") {
        $filter_image_ids = mtheme_get_custom_attachments($featured_page);
        get_header();
        if ($filter_image_ids) {
            ?>
            <style type="text/css">
                body {
                    top:0;
                    left:0;
                    width:100%;
                    height:100%;
                    overflow:hidden;
                }
            </style>
            <div class="kenburns-preloader"></div>
            <div id="kenburns-container">
                <?php 
Example #3
0
function mtheme_Thumbnails($atts, $content = null)
{
    extract(shortcode_atts(array("size" => 'thumbnail', "exclude_featured" => 'false', "start" => '', "end" => '', "columns" => '4', "title" => "false", "description" => "false", "id" => '1', "pageid" => ''), $atts));
    // Set a default
    $column_type = "four";
    $portfolioImage_type = "gridblock-small";
    if ($columns == 4) {
        $column_type = "four";
        $portfolioImage_type = "gridblock-small";
    }
    if ($columns == 3) {
        $column_type = "three";
        $portfolioImage_type = "gridblock-medium";
    }
    if ($columns == 2) {
        $column_type = "two";
        $portfolioImage_type = "gridblock-large";
    }
    if ($columns == 1) {
        $column_type = "one";
        $portfolioImage_type = "gridblock-full";
    }
    $portfolio_count = 0;
    $thumbnailcount = 0;
    $thepageID = get_the_id();
    if ($pageid != '') {
        $thepageID = $pageid;
    }
    if ($end < $start) {
        $end = '';
        $start = '';
    }
    $filter_image_ids = mtheme_get_custom_attachments($thepageID);
    if ($filter_image_ids) {
        ob_start();
        echo '<div class="thumbnails-shortcode gridblock-columns-wrap clearfix">';
        echo '<ul class="gridblock-' . $column_type . '">';
        $featuredID = get_post_thumbnail_id();
        foreach ($filter_image_ids as $attachment_id) {
            $thumbnailcount++;
            if ($start != '') {
                if ($thumbnailcount < $start) {
                    continue;
                }
            }
            if ($end != '') {
                if ($thumbnailcount > $end) {
                    continue;
                }
            }
            if ($exclude_featured == 'true') {
                if ($featuredID == $attachment_id) {
                    continue;
                }
                // skip rest of the loop
            }
            $imagearray = wp_get_attachment_image_src($attachment_id, 'fullsize', false);
            $imageURI = $imagearray[0];
            $thumbnail_imagearray = wp_get_attachment_image_src($attachment_id, $portfolioImage_type, false);
            $thumbnail_imageURI = $thumbnail_imagearray[0];
            $imageID = get_post($attachment_id);
            $imageTitle = $imageID->post_title;
            $imageDesc = $imageID->post_content;
            if ($portfolio_count == $columns) {
                $portfolio_count = 0;
            }
            $portfolio_count++;
            if ($portfolio_count == 1) {
                echo '<li class="clearfix"></li>';
            }
            echo '<li class="gridblock-element gridblock-col-' . $portfolio_count . '">';
            echo '<span class="gridblock-thumbnail-image-wrap">';
            echo '<span class="gridblock-link-hover">';
            $linkcenter = "gridblock-link-center";
            echo mtheme_activate_lightbox($lightbox_type = "prettyPhoto", $ID = '', $link = $imageURI, $mediatype = "image", $imagetitle = $imageTitle, $class = "thumbnail-shortcode-columns", $navigation = "prettyPhoto[portfolio]");
            echo '<span class="hover-icon-effect column-gridblock-link ' . $linkcenter . '"><i class="icon-plus"></i></span></a>';
            echo '</span>';
            echo '<span class="gridblock-background-hover"></span>';
            ?>
			<img class="displayed-image" src="<?php 
            echo $thumbnail_imagearray[0];
            ?>
" alt="<?php 
            echo mtheme_get_alt_text($attatchmentID);
            ?>
">
			<?php 
            echo '</span>';
            if ($title == "true" || $description == "true") {
                $portfoliogrid = '<div class="work-details">';
                if ($title == 'true') {
                    $portfoliogrid .= '<h4>';
                    $portfoliogrid .= '' . $imageTitle . '';
                    $portfoliogrid .= '</h4>';
                }
                if ($description == 'true') {
                    $portfoliogrid .= '<p class="entry-content work-description">' . $imageDesc . '</p>';
                }
                $portfoliogrid .= '</div>';
                echo $portfoliogrid;
            }
            ?>
		</li>
			<?php 
        }
        ?>
		</ul>
		</div>

<?php 
        $content = ob_get_contents();
        ob_end_clean();
        return $content;
    }
}
Example #4
0
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $clickaction = "";
        $thepage = "";
        $thecategory = "";
        $listchoice = "";
        $galleryorder = "";
        $thumbsize = "";
        $thelimit = -1;
        $columnbreak = "3";
        $height = 82;
        $width = 82;
        $gridtype = "infobar-portfoliogrid";
        if (isset($instance['clickaction'])) {
            $clickaction = $instance['clickaction'];
        }
        if (isset($instance['thepage'])) {
            $thepage = $instance['thepage'];
        }
        if (isset($instance['thecategory'])) {
            $thecategory = $instance['thecategory'];
        }
        if (isset($instance['theportfolio'])) {
            $theportfolio = $instance['theportfolio'];
        }
        if (isset($instance['listchoice'])) {
            $listchoice = $instance['listchoice'];
        }
        if (isset($instance['thelimit'])) {
            $thelimit = $instance['thelimit'];
        }
        if (isset($instance['galleryorder'])) {
            $galleryorder = $instance['galleryorder'];
        }
        if (isset($instance['thumbsize'])) {
            $thumbsize = $instance['thumbsize'];
        }
        echo $before_widget;
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        $gridtype = "infobar-portfoliogrid";
        $quality = MTHEME_IMAGE_QUALITY;
        $count = 0;
        $vkey = "video";
        ?>
			
			<div>
			<ul class="<?php 
        echo $gridtype;
        ?>
">
			
			<?php 
        switch ($listchoice) {
            case "portfolio":
                global $post;
                if ($theportfolio == "BLANK") {
                    $theportfolio = "";
                }
                $newquery = array('post_type' => 'mtheme_portfolio', 'types' => $theportfolio, 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => $thelimit);
                query_posts($newquery);
                if (have_posts()) {
                    while (have_posts()) {
                        the_post();
                        $count++;
                        $image_id = get_post_thumbnail_id($post->ID, 'fullpage');
                        $image_url = wp_get_attachment_image_src($image_id, 'fullpage');
                        $image_url = $image_url[0];
                        $thumbnail_image_id = get_post_thumbnail_id($post->ID, 'gridblock-tiny');
                        $thumbnail_image_url = wp_get_attachment_image_src($image_id, 'gridblock-tiny');
                        $thumbnail_image_url = $thumbnail_image_url[0];
                        $imageTitle = get_the_title($post->ID);
                        $video = get_post_meta($post->ID, $vkey, true);
                        $hovericon = "imageicon";
                        $lightbox_url = $image_url;
                        if ($video != "") {
                            $hovericon = "videoicon";
                            $lightbox_url = $video;
                        }
                        if ($count == $columnbreak) {
                            $class_string = $hovericon;
                            $count = 0;
                        } else {
                            $class_string = "rightspace " . $hovericon;
                        }
                        ?>

						<li class="<?php 
                        echo $class_string;
                        ?>
">
						<?php 
                        if ($clickaction == "lightbox" && !post_password_required()) {
                            ?>
							<a rel="prettyPhoto[<?php 
                            echo $args['widget_id'];
                            ?>
]" href="<?php 
                            echo $lightbox_url;
                            ?>
" title="<?php 
                            echo $imageTitle;
                            ?>
">
							<?php 
                        } else {
                            ?>
							<a href="<?php 
                            the_permalink();
                            ?>
">
							<?php 
                        }
                        ?>
								<?php 
                        if (post_password_required()) {
                            $have_image_url = get_template_directory_uri() . '/images/icons/post_locked.png';
                        } else {
                            $have_image_url = $thumbnail_image_url;
                        }
                        echo mtheme_display_post_image($post->ID, $have_image_url, $link = false, $type = "", $post->post_title, $class = "sidegalleryfade");
                        ?>
							</a>
						</li>			
					
					<?php 
                    }
                }
                break;
                // If the choice is Pages
            // If the choice is Pages
            case "page":
                $filter_image_ids = mtheme_get_custom_attachments($thepage);
                $page_title = get_the_title($thepage);
                $page_link = get_page_link($thepage);
                foreach ($filter_image_ids as $attatchmentID) {
                    $imagearray = wp_get_attachment_image_src($attatchmentID, 'fullsize', false);
                    $imageURI = $imagearray[0];
                    $thumbnail_imagearray = wp_get_attachment_image_src($attatchmentID, 'gridblock-tiny', false);
                    $thumbnail_imageURI = $thumbnail_imagearray[0];
                    $imageID = get_post($attatchmentID);
                    $imageTitle = apply_filters('the_title', $imageID->post_title);
                    $postlink = get_permalink($imageID->post_parent);
                    $attatchmentURL = get_attachment_link($imageID->ID);
                    $count++;
                    if ($count == $columnbreak) {
                        $class_string = "imageicon";
                        $count = 0;
                    } else {
                        $class_string = "rightspace imageicon";
                    }
                    ?>

						<li class="<?php 
                    echo $class_string;
                    ?>
">
						<?php 
                    if ($clickaction == "lightbox") {
                        ?>
							<a rel="prettyPhoto[<?php 
                        echo $args['widget_id'];
                        ?>
]" href="<?php 
                        echo $imageURI;
                        ?>
">
							<?php 
                    } else {
                        ?>
							<a href="<?php 
                        echo $attatchmentURL;
                        ?>
">
							<?php 
                    }
                    ?>
								<?php 
                    echo mtheme_display_post_image(get_the_ID(), $have_image_url = $thumbnail_imageURI, $link = false, $type = "", $imageTitle, $class = "sidegalleryfade");
                    ?>
							</a>
						</li>
							<?php 
                }
                break;
            case "category":
                // If the choice is Posts in Categories
                global $post;
                query_posts(array('cat' => $thecategory, 'showposts' => $thelimit, 'post_status' => 'publish', 'order' => 'ASC', 'orderby' => $galleryorder));
                while (have_posts()) {
                    the_post();
                    $count++;
                    $image_id = get_post_thumbnail_id($post->ID, 'fullsize');
                    $image_url = wp_get_attachment_image_src($image_id, 'fullsize');
                    $image_url = $image_url[0];
                    $thumbnail_image_id = get_post_thumbnail_id($post->ID, 'gridblock-tiny');
                    $thumbnail_image_url = wp_get_attachment_image_src($thumbnail_image_id, 'gridblock-tiny');
                    $thumbnail_image_url = $thumbnail_image_url[0];
                    $imageTitle = get_the_title($post->ID);
                    $video = get_post_meta($post->ID, $vkey, true);
                    $hovericon = "imageicon";
                    $lightbox_url = $image_url;
                    if ($video != "") {
                        $hovericon = "videoicon";
                        $lightbox_url = $video;
                    }
                    if ($count == $columnbreak) {
                        $class_string = $hovericon;
                        $count = 0;
                    } else {
                        $class_string = "rightspace " . $hovericon;
                    }
                    ?>

						<li class="<?php 
                    echo $class_string;
                    ?>
">
						<?php 
                    if ($clickaction == "lightbox") {
                        ?>
							<a rel="prettyPhoto[<?php 
                        echo $args['widget_id'];
                        ?>
]" href="<?php 
                        echo $lightbox_url;
                        ?>
">
							<?php 
                    } else {
                        ?>
							<a href="<?php 
                        the_permalink();
                        ?>
">
							<?php 
                    }
                    ?>
								<?php 
                    echo mtheme_display_post_image($post->ID, $have_image_url = $thumbnail_image_url, $link = false, $type = "", $post->post_title, $class = "sidegalleryfade");
                    ?>
							</a>
						</li>
							<?php 
                }
                ?>
							
			
			<?php 
                wp_reset_query();
                break;
        }
        ?>
			</ul>
			<div class="clear"></div>
			</div>
		<?php 
        echo $after_widget;
    }
Example #5
0
/**
 * AJAX Flexi Slideshow .
 *
 * @ [flexislideshow link=(lightbox,direct,none)]
 */
function mtheme_Verticalimages($atts, $content = null)
{
    extract(shortcode_atts(array("id" => '1', "height" => '', "width" => '', "imagesize" => 'portfolio-ajax'), $atts));
    //echo $type, $portfolio_type;
    global $mtheme_thepostID;
    $flexID = "ID" . dechex(time()) . dechex(mt_rand(1, 65535));
    $filter_image_ids = mtheme_get_custom_attachments($mtheme_thepostID);
    $uniqurePageID = dechex(mt_rand(1, 65535));
    if ($filter_image_ids) {
        $output = '
			<ul class="vertical_images clearfix">';
        foreach ($filter_image_ids as $attachment_id) {
            $imagearray = wp_get_attachment_image_src($attachment_id, $imagesize, false);
            $imageURI = $imagearray[0];
            $imageID = get_post($attachment_id);
            $imageTitle = $imageID->post_title;
            $imageCaption = $imageID->post_excerpt;
            $fullimagearray = wp_get_attachment_image_src($attachment_id, '', false);
            $fullimageURI = $fullimagearray[0];
            $output .= '<li>';
            $output .= '<a class="vertical-images-link" rel="prettyPhoto[' . $uniqurePageID . ']" href="' . $fullimageURI . '">';
            $output .= mtheme_showimage($imageURI, $link = "", $resize = false, $height, $width, $quality = MTHEME_IMAGE_QUALITY, $crop = 1, $alt_text = mtheme_get_alt_text($attachment_id), $class = "");
            $output .= '</a>';
            if ($imageTitle != "") {
                $output .= '<div class="vertical-images-title">' . $imageTitle . '</div>';
            }
            $output .= '</li>';
        }
        $output .= '</ul>';
        return $output;
    }
}