function widget($args, $instance) { extract($args); $instance["width"] = $grid_width; global $wp_filter; $the_content_filter_backup = $wp_filter['the_content']; if ($instance["paje"]) { $query = array('page_id' => (int) $instance["paje"]); $r = new WP_Query($query); echo $before_widget; if ($instance['title']) { echo $before_title . $instance['title'] . $after_title; } ?> <?php if ($r->have_posts()) { while ($r->have_posts()) { $r->the_post(); global $post; $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); if ($img) { $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $instance["width"], $instance["height"], true); } if ($img && $instance['image'] == 'btitle') { echo '<img src="' . $imgsrc . '" />'; } if ($instance["titl"] == 'true') { echo '<h3 class="element-title">'; the_title(); echo '</h3>'; } if ($img && $instance['image'] == 'atitle') { echo '<img src="' . $imgsrc . '" />'; } the_content(); } } echo $after_widget; wp_reset_postdata(); } $wp_filter['the_content'] = $the_content_filter_backup; }
function widget($args, $instance) { extract( $args ); $instance["width"]=$grid_width; if($instance["paje"]){ $post_id = $instance["paje"]; $post_self = get_post($post_id); echo $before_widget; if ( $instance['title']) echo $before_title . $instance['title'] . $after_title; $img = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'large') ; if ($img){ $imgsrc = UltimatumImageResizer( get_post_thumbnail_id($post_id), null,$instance["width"], $instance["height"], true ); } if($img && $instance['image']=='btitle'){ echo '<img src="'.$imgsrc.'" />'; } if($instance["titl"]=='true'){ echo '<h3 class="element-title">'; echo $post_self->post_title; echo '</h3>'; } if($img && $instance['image']=='atitle'){ echo '<img src="'.$imgsrc.'" />'; } $content = apply_filters( 'ult_widget_content', $post_self->post_content, $post_id ); echo $content; echo $after_widget; } }
function ultimatum_custom_loop_image( $args, $instance, $imgw, $rel, $align, $gallery ) { global $post; extract( $args ); $img = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); $imgsrc = false; if ( ! $img && $instance["mnoimage"] == 'true' ) { $img[0] = null; if ( get_ultimatum_option( 'general', 'noimage' ) ) { $img[0] = get_ultimatum_option( 'general', 'noimage' ); } $imgsrc = UltimatumImageResizer( null, $img[0], $imgw, $instance["multipleh"], true ); } elseif ( is_array( $img ) ) { $imgsrc = UltimatumImageResizer( get_post_thumbnail_id(), null, $imgw, $instance["multipleh"], true ); } if ( $imgsrc ) { ?> <div class="featured-image <?php echo $align;?>" <?php if ($gallery){ ?>style="position: relative"<?php } ?>> <?php $video = get_post_meta( $post->ID, 'ultimatum_video', true ); if ( $gallery ) { if ( $video ) { $link = $video . ''; } else { $link = $img[0]; if ( preg_match( '/holder.js/i', $imgsrc ) ) { $link = ''; $rel = ''; } } } if ( $instance["mvideo"] == 'true' ) { if ( get_post_meta( $post->ID, '_image_ids', true ) && ! $gallery && $instance['ult_full_image'] ) { post_gallery( $imgw, $instance["multipleh"], $instance ); } elseif ( get_post_meta( $post->ID, 'ultimatum_video', true ) && ! $gallery ) { $sc = '[ult_video width="' . $imgw . '" height="' . $instance["multipleh"] . '"]' . $video . '[/ult_video]'; echo do_shortcode( $sc ); } else { ?> <a href="<?php if ( $gallery ) { echo $link; } else { the_permalink(); } ?>" <?php echo $rel ?> class="preload <?php if ( $gallery ) { echo ' overlayed_image'; } ?>" <?php if ( $gallery ) { if ( $video ) { echo ' data-overlay="play"'; } else { echo ' data-overlay="image"'; } } ?>> <img src="<?php echo $imgsrc; ?>" alt="<?php the_title(); ?>"/> </a><?php } } else { ?> <a href="<?php if ( $gallery ) { echo $link; } else { the_permalink(); } ?>" <?php echo $rel ?> class="preload <?php if ( $gallery ) { echo ' overlayed_image'; } ?>" <?php if ( $gallery ) { if ( $video ) { echo ' data-overlay="play"'; } else { echo ' data-overlay="image"'; } } ?>> <img src="<?php echo $imgsrc; ?>" alt="<?php the_title(); ?>"/> </a><?php } ?> </div><?php } }
function widget($args, $instance) { extract($args); //$grid_width; $source = $instance['source']; $count = $instance['count']; if ($instance['slide'] != "false") { wp_enqueue_script('jquery-easing', THEME_JS . '/jquery.easing.min.js'); wp_enqueue_script('jquery-bxslider', THEME_JS . '/jquery.bxSlider.min.js'); } if ($instance['layout'] == 5 || $instance['layout'] == 6 || $instance['layout'] == 7 || $instance['layout'] == 8) { if ($instance['slide'] != "false") { $itemwidth = ($grid_width - ($instance['sitems'] - 1) * $instance['margin']) / $instance['sitems']; } else { $itemwidth = ($grid_width - ($count - 1) * $instance['margin']) / $count; } } else { $itemwidth = $grid_width; } global $wp_filter; $the_content_filter_backup = $wp_filter['the_content']; if (eregi('ptype-', $source)) { $post_type = str_replace('ptype-', '', $source); } elseif (eregi('cat-', $source)) { $post_type = 'post'; $cat = str_replace('cat-', '', $source); } elseif (eregi('taxonomy-', $source)) { $prop = explode('|', str_replace('taxonomy-', '', $source)); $post_type = $prop[0]; global $wp_version; if (version_compare($wp_version, "3.1", '>=')) { $query['tax_query'] = array(array('taxonomy' => $prop[1], 'field' => 'slug', 'terms' => explode(',', $prop[2]))); } else { $query['taxonomy'] = $prop[1]; $query['term'] = $prop[2]; } } $query = array('posts_per_page' => (int) $count, 'post_type' => $post_type, 'orderby' => 'date', 'order' => 'DESC'); if ($cat) { $query['cat'] = $cat; } $query['showposts'] = $count; $r = new WP_Query($query); $j = 1; echo $before_widget; if ($instance['slide'] != 'false') { ?> <div class="<?php echo $instance[AnyColor]; ?> " style="float:left"> <?php } if ($instance['title']) { if ($instance['slide'] != 'false') { ?> <h3 class="bxtitle element-title"><?php echo $instance[title]; ?> </h3> <?php } else { echo $before_title . $instance['title'] . $after_title; } } ?> <div id="<?php echo $this->id . '-recent'; ?> "> <?php if ($r->have_posts()) { while ($r->have_posts()) { $r->the_post(); global $post; $link = get_permalink(); ?> <?php if ($instance[slide] != "false") { ?> <?php if ($instance[layout] == 1 || $instance[layout] == 2 || $instance[layout] == 3 || $instance[layout] == 4) { ?> <div class="recenposts" style="width:<?php echo $grid_width; ?> px;height:<?php echo $instance['sitemh']; ?> px;float:left;margin-bottom:<?php echo $instance[margin]; ?> px""> <div class="recentinner" style="<?php echo 'margin: 0 auto;'; ?> "> <?php } else { ?> <div class="recenposts" style="width:<?php echo $grid_width / $instance['sitems']; ?> px;float:left;"> <div class="recentinner" style="width: <?php echo $itemwidth; ?> px;<?php echo 'margin: 0 auto;'; ?> "> <?php } ?> <?php } else { ?> <div class="recenposts" style="width:<?php echo $itemwidth; ?> px;float:left;<?php if ($j == $count) { } else { if ($instance[layout] == 1 || $instance[layout] == 2 || $instance[layout] == 3 || $instance[layout] == 4) { echo "margin-bottom:" . $instance[margin] . "px"; } else { echo "margin-right:" . $instance[margin] . "px"; } } ?> "> <div class="recentinner" style="width: <?php echo $itemwidth; ?> px;"> <?php } ?> <?php if ($instance['layout'] == 1 || $instance['layout'] == 5) { $imgwidth = $itemwidth; $images = true; $imagealign = 'noalign'; } elseif ($instance['layout'] == '2' || $instance['layout'] == '6' || $instance['layout'] == '3' || $instance['layout'] == '7') { $imgwidth = $instance[width]; $images = true; if ($instance['layout'] == '2' || $instance['layout'] == '6') { $imagealign = 'alignleft'; } else { $imagealign = 'alignright'; } } if ($images) { $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); if ($img) { $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgwidth, $instance["height"], true); } else { $nimg = THEME_URI . '/images/no-image.jpg'; $imgsrc = UltimatumImageResizer(null, $nimg, $imgwidth, $instance["height"], true); } if ($instance[gallery] == 'false') { echo '<a href="' . $link . '"><img src="' . $imgsrc . '" alt="' . get_the_title($post->ID) . '" '; if ($imagealign) { echo 'class="' . $imagealign . '"'; } echo ' alt="' . get_the_title() . '" /></a>'; } else { $video = get_post_meta($post->ID, 'ultimatum_video', true); if ($video) { echo '<a href="' . $video . '" class="image_play prettyPhoto" style="position:relative;float:left;width:' . $imgwidth . 'px;height:' . $instance[height] . 'px"><img src="' . $imgsrc . '" alt="' . get_the_title($post->ID) . '" '; if ($imagealign) { echo 'class="' . $imagealign . '"'; } echo ' alt="' . get_the_title() . '" /></a>'; } else { echo '<a href="' . $img[0] . '" class="image_zoom prettyPhoto" style="position:relative;float:left;width:' . $imgwidth . 'px;height:' . $instance[height] . 'px"><img src="' . $imgsrc . '" alt="' . get_the_title($post->ID) . '" '; if ($imagealign) { echo 'class="' . $imagealign . '"'; } echo ' alt="' . get_the_title() . '" /></a>'; } } } ?> <?php if ($instance['showtitle'] == 'true') { ?> <?php if ($instance['tlength'] != 0) { $post_title = get_the_title(); if (strlen($post_title) > $instance['tlength']) { $post_title = substr($post_title, 0, $instance['tlength']) . '...'; } ?> <h4 class="recentposth3"><a href="<?php echo $link; ?> " class="recentlink"><?php echo $post_title; ?> </a></h4> <?php } else { ?> <h4 class="recentposth3"><a href="<?php echo $link; ?> " class="recentlink"><?php the_title(); ?> </a></h4> <?php } ?> <?php } ?> <?php if ($instance['showex'] == 'true') { ?> <p><?php echo wp_html_excerpt(get_the_excerpt(), $instance[exlength]); ?> ...</p> <?php } ?> <?php if ($instance['showrm'] == 'true') { ?> <a href="<?php echo $link; ?> " class="recentreadmorelink"><span><?php _e($instance[rmtext], THEME_LANG_DOMAIN); ?> </span></a> <?php } ?> </div> </div> <?php $j++; } } ?> </div> <?php if ($instance['slide'] != 'false') { ?> </div> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function(){ jQuery('#<?php echo $this->id . '-recent'; ?> ').bxSlider({ <?php if ($instance['slide'] == 'ticker') { echo "\n"; ?> auto: true, <?php } ?> <?php if ($instance['layout'] == '1' || $instance['layout'] == '2' || $instance['layout'] == '3' || $instance['layout'] == '4') { echo "\n"; ?> mode: 'vertical',<?php } ?> autoHover: true, easing : 'easeInOutBack', speed:2000, displaySlideQty: <?php echo $instance['sitems']; ?> , moveSlideQty: 1 }); }); //]]> </script> <?php } ?> <?php echo $after_widget; wp_reset_postdata(); $wp_filter['the_content'] = $the_content_filter_backup; }
px;height:<?php echo $instance[Height]; ?> px"> <dl class="slidedeck" id="<?php echo $this->id . '-sdeck'; ?> "> <?php foreach ($images as $image) { if ($uslider) { $img_src['url'] = THEME_SLIDESHOW . '/' . $instance['slide'] . '/' . $image['image']; $img_src['fpath'] = THEME_SLIDESHOW_DIR . '/' . $instance['slide'] . '/' . $image['image']; $imgsrc = UltimatumImageResizer(null, $img_src, $instance["SDWidth"], $instance["SDHeight"], true); } else { $imgsrc = UltimatumImageResizer($image['image_id'], null, $instance["SDWidth"], $instance["SDHeight"], true); } ?> <dt><?php echo $image[title]; ?> </dt> <dd> <div style="float:left;width:100%;"> <?php if ($instance[SDVideo] == 'true' && strlen($image[video]) >= 3) { ?> <div style="float:right;margin-left:10px;"> <?php $sc = '[video width="' . $instance[SDWidth] . '" height="' . $instance[SDHeight] . '"]' . $image[video] . '[/video]'; echo do_shortcode($sc);
<?php wp_enqueue_style('slider-elastic'); wp_enqueue_script('jquery-easing'); wp_enqueue_script('slider-elastic'); foreach($images as $image){ $imgsrc[] = array($image['title'],$image['text'],UltimatumImageResizer( $image['image_id'], null,$instance["Width"], $instance["Height"], true )); $thmubs[] = array($image['title'],UltimatumImageResizer( $image['image_id'], null,150, 60, true )); } ?> <style> #<?php echo $this->id.'elastic'; ?>{ height: <?php echo $instance['Height'];?>px; } </style> <div id="<?php echo $this->id.'elastic'; ?>" class="ei-slider"> <ul class="ei-slider-large"> <?php foreach($imgsrc as $imz){?> <li> <img src="<?php echo $imz[2];?>" alt="image06" /> <div class="ei-title"> <h2><?php echo $imz[0];?></h2> <p><?php echo $imz[1];?></p> </div> </li> <?php }?> </ul><!-- ei-slider-large --> <ul class="ei-slider-thumbs"> <li class="ei-slider-element">Current</li> <?php foreach($thmubs as $imt){?> <li><a href="#"><?php echo $imt[1];?></a><img src="<?php echo $imt[1];?>" alt="thumb06" /></li>
function widget($args, $instance) { extract($args); $i = 1; $title = apply_filters('widget_title', $instance['title']); $colprops = explode('-', $instance["multiple"]); $count = $instance["perpage"]; $colcount = $colprops[0]; $gallery = false; $noimage = false; $rel = ''; switch ($colcount) { case '1': $grid = $grid_width; $cols = 1; $colw = $grid_width; break; case '2': $grid = ($grid_width - $instance["mmargin"]) / 2; $cols = 2; $colw = $grid; break; case '3': $grid = ($grid_width - $instance["mmargin"] * 2) / 3; $cols = 3; $colw = $grid; break; case '4': $grid = ($grid_width - $instance["mmargin"] * 3) / 4; $cols = 4; $colw = $grid; break; } $colcount = $cols; if ($colcount == 1 && ($colprops[2] == 'ri' || $colprops[2] == 'li' || $colprops[2] == 'gl' || $colprops[2] == 'gr')) { $imgw = $instance[multiplew]; } else { $imgw = $colw; } switch ($colprops[2]) { case 'ri': $align = 'float:right;margin-top:4px;margin-left:15px;'; break; case 'li': $align = 'float:left;margin-top:4px;margin-right:15px;'; break; case 'gl': $align = 'float:left;margin-top:4px;margin-right:15px;'; $rel = 'rel="prettyPhoto[]"'; $gallery = true; break; case 'gr': $align = 'float:right;margin-left:15px;margin-top:4px;'; $rel = 'rel="prettyPhoto[]"'; $gallery = true; break; case 'g': $rel = 'rel="prettyPhoto[]"'; $gallery = true; break; case 'i': break; default: $noimage = true; break; } //Print the Style ?> <style type="text/css"> #<?php echo $widget_id; ?> { float:left; width:<?php echo $grid; ?> px; margin-right:<?php echo $instance["mmargin"]; ?> px; } #<?php echo $widget_id; ?> .aligner { <?php echo $align; ?> } </style> <?php if ($responsivetheme) { ?> <style type="text/css"> @media screen and (min-width:720px) and (max-width: 979px) { #<?php echo $widget_id; ?> { float:left; width:100%; margin-right:0; } #<?php echo $widget_id; ?> .aligner { <?php if (isset($align)) { echo $align; } else { echo 'width:100%;'; } ?> } #<?php echo $widget_id; ?> .aligner img { max-width:100%; } } @media screen and (min-width:320px) and (max-width: 719px) { #<?php echo $widget_id; ?> { float:left; width:100%; } #<?php echo $widget_id; ?> .aligner { width:100%; } #<?php echo $widget_id; ?> .aligner img { max-width:100%; } } </style> <?php } ?> <?php global $wp_filter; $source = $instance['source']; $the_content_filter_backup = $wp_filter['the_content']; $looporder1 = isset($instance['looporder1']) ? $instance['looporder1'] : ''; $looporder2 = isset($instance['looporder2']) ? $instance['looporder2'] : ''; $skip = isset($instance['skip']) ? $instance['skip'] : 0; // set order defaults $orderby = 'date'; $order = 'DESC'; $order = isset($instance['orderdir']) ? $instance['orderdir'] : 'DESC'; if ($looporder1) { $orderby = $looporder1; $setby1 = true; } if ($looporder2) { if ($setby1) { $orderby .= ' ' . $looporder2; } else { $orderby = $looporder2; } } if (eregi('ptype-', $source)) { $post_type = str_replace('ptype-', '', $source); } elseif (eregi('cat-', $source)) { $post_type = 'post'; $cat = str_replace('cat-', '', $source); } elseif (eregi('taxonomy-', $source)) { $prop = explode('|', str_replace('taxonomy-', '', $source)); $post_type = $prop[0]; $taxonmy['taxonomy'] = $prop[1]; $taxonmy['term'] = $prop[2]; } $query = array('posts_per_page' => (int) $count, 'post_type' => $post_type, 'orderby' => $orderby, 'order' => $order); if ($skip > 0) { $query['offset'] = $skip; } if ($cat) { $query['cat'] = $cat; } if (isset($taxonmy)) { $query['taxonomy'] = $taxonmy['taxonomy']; $query['term'] = $taxonmy['term']; } $query['showposts'] = $count; $r = new WP_Query($query); if ($r->have_posts()) { while ($r->have_posts()) { $r->the_post(); global $post; if ($colcount != 1) { //gridd if ($i == 1) { $i++; $gps = false; } elseif ($i == $colcount) { $gps = true; $i = 1; } else { $i++; $gps = false; } } else { $grid = ''; $gps = ''; } //gridd ?> <div class="post post-<?php echo $post->ID; ?> ultimatepost-custom <?php if ($gps) { echo "last"; } ?> " id="<?php echo $widget_id; ?> "> <div class="post-inner"> <?php $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); if (!$img && $instance["mnoimage"] == 'true') { if (get_theme_option('general', 'noimage')) { $img[0] = get_theme_option('general', 'noimage'); } else { $img[0] = THEME_URI . '/images/no-image.jpg'; } $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["multipleh"], true); } else { $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["multipleh"], true); } if (!$noimage) { $video = get_post_meta($post->ID, 'ultimatum_video', true); $sc = '[video width="100%" height="' . $instance["multipleh"] . '"]' . $video . '[/video]'; if ($imgw != $colw || $instance["mimgpos"] == 'btitle') { ?> <div class="aligner"> <div class="featured-image"> <?php if ($gallery) { if ($video) { $link = $video . ''; } else { $link = $img[0]; } } if ($img) { if ($video && $instance["mvideo"] == 'replace') { echo do_shortcode($sc); } else { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> class="preload <?php if ($gallery) { if ($video) { echo 'image_play'; } else { echo 'image_zoom'; } } ?> " style="position:relative;float:left;padding:0;margin:0;line-height:0px;" > <img src="<?php echo $imgsrc; ?> " style="padding:0;margin:0;line-height:0px;" alt="<?php the_title(); ?> " /> </a> <?php } if ($video && $instance["mvideo"] == 'aimage') { echo do_shortcode($sc); } } ?> </div> <?php if ($instance["mmeta"] == 'aimage') { echo $this->blog_multimeta($instance); } ?> </div> <?php } } if (!$grid) { $wi = $grid_width - ($imgw + 15); echo '<div>'; } else { echo '<div>'; } ?> <?php if ($instance["mtitle"] == 'true') { ?> <h2 class="post-header"> <?php if ($rel) { ?> <?php the_title(); ?> <?php } else { ?> <a class="post-title" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <?php } ?> </h2> <?php } ?> <?php if ($imgw == $colw && $instance["mimgpos"] == 'atitle') { ?> <div class="aligner"> <div class="featured-image"> <?php if ($gallery) { if ($video) { $link = $video . ''; } else { $link = $img[0]; } } if ($img) { ?> <?php if ($video && $instance["mvideo"] == 'replace') { ?> <?php echo do_shortcode($sc); ?> <?php } else { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> class="preload"><img src="<?php echo $imgsrc; ?> " alt="<?php the_title(); ?> " /></a> <?php } ?> <?php if ($video && $instance["mvideo"] == 'aimage') { ?> <?php echo do_shortcode($sc); ?> <?php } ?> <?php } ?> </div> <?php if ($instance["mmeta"] == 'aimage') { echo $this->blog_multimeta($instance); } ?> </div> <?php } ?> <?php if ($video && $instance["mvideo"] == 'atitle') { ?> <?php echo do_shortcode($sc); ?> <?php } ?> <?php if ($instance["mmeta"] == 'atitle') { echo $this->blog_multimeta($instance); } ?> <?php if ($instance["excerpt"] == 'true') { ?> <p class="post-excerpt"><?php echo wp_html_excerpt(get_the_excerpt(), $instance["excerptlength"]); ?> ...</p> <?php } elseif ($instance['excerpt'] == 'content') { ?> <p class="post-excerpt"><?php the_content(); ?> </p> <?php } ?> <?php if ($instance["mmeta"] == 'atext') { echo $this->blog_multimeta($instance); } $tax = ''; if ($instance["mcats"] == 'acontent') { $tax = array(); $_tax = array(); $_tax = get_the_taxonomies(); if (empty($_tax)) { } else { foreach ($_tax as $key => $value) { preg_match('/(.+?): /i', $value, $matches); $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>'; } } echo '<div class="post-meta taxonomy">' . join('<br />', $tax) . '</div>'; } if ($instance["mreadmore"] != 'false') { ?> <p style="text-align:<?php echo $instance["mreadmore"]; ?> "> <a href="<?php the_permalink(); ?> " class="readmorecontent" > <?php _e($instance["rmtext"], THEME_LANG_DOMAIN); ?> </a> </p> <?php } ?> </div> </div> </div> <?php if ($i == 1) { echo '<div style="clear:both"></div>'; } } } ?> <?php echo '<div style="clear:both"></div>'; ?> <?php wp_reset_postdata(); $wp_filter['the_content'] = $the_content_filter_backup; }
function widget($args, $instance) { extract($args); $per_page = $instance["perpage"]; if (ULTIMATUM_LOOP != 'wp') { include "loops/" . ULTIMATUM_LOOP . ".php"; } else { if (is_single() || is_page()) { if (preg_match('/.php/i', $instance["single"])) { $loopfile = $instance["single"]; } } else { global $wp_query; $paged = get_query_var('paged') && get_query_var('paged') > 1 ? get_query_var('paged') : 1; $args = array_merge($wp_query->query, array('posts_per_page' => $per_page, "paged" => $paged)); query_posts($args); if (preg_match('/.php/i', $instance["multiple"])) { $loopfile = $instance["multiple"]; } } if ($loopfile) { include THEME_LOOPS_DIR . '/' . $loopfile; } else { $title = apply_filters('widget_title', $instance['title']); $colprops = explode('-', $instance["multiple"]); $colcount = $colprops[0]; $gallery = false; $noimage = false; $rel = ''; switch ($colcount) { case '1': $grid = $grid_width; $cols = 1; $colw = $grid_width; break; case '2': $grid = ($grid_width - $instance["mmargin"]) / 2; $cols = 2; $colw = $grid; break; case '3': $grid = ($grid_width - $instance["mmargin"] * 2) / 3; $cols = 3; $colw = $grid; break; case '4': $grid = ($grid_width - $instance["mmargin"] * 3) / 4; $cols = 4; $colw = $grid; break; } ?> <div id="content"> <?php $i = 1; if (is_single() || is_page()) { if (have_posts()) { while (have_posts()) { the_post(); global $post; switch ($instance["single"]) { case 'rimage': $image = true; $align = "float:right;margin-left:20px;"; $imgw = $instance["singlew"]; break; case 'limage': $image = true; $align = "float:left;margin-right:20px;"; $imgw = $instance["singlew"]; break; case 'fimage': $image = true; $imgw = $grid_width; $imgw = $instance["singlew"]; $align = ''; break; default: $image = false; $align = ''; break; } $styler = ' <style type="text/css"> #' . $widget_id . '{ float:left; width:100%; } #' . $widget_id . ' .aligner{ ' . $align . ' } '; if ($responsivetheme) { $styler .= ' @media screen and (min-width:720px) and (max-width: 979px) { #' . $widget_id . '{ float:left; width:100%; margin-right:0; } #' . $widget_id . ' .aligner {'; if (isset($align)) { $styler .= $align; } else { $styler .= 'width:100%;'; } $styler .= ' } #' . $widget_id . ' .aligner img{ max-width:100%; } } @media screen and (min-width:240px) and (max-width: 719px) { #' . $widget_id . '{ float:left; width:100%; } #' . $widget_id . ' .aligner { width:100%; } #' . $widget_id . ' .aligner img{ max-width:100%; } }'; } $styler .= '</style>'; echo $styler; ?> <div class="post-<?php echo $post->ID; ?> ultimatepost" id="<?php echo $widget_id; ?> "> <div class="post-inner-single"> <?php if ($image) { $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); if (!isset($img) && $instance["noimage"] == 'true') { if (get_theme_option('general', 'noimage')) { $img[0] = get_theme_option('general', 'noimage'); } else { $img[0] = THEME_URI . '/images/no-image.jpg'; } $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["singleh"], true); } else { $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["singleh"], true); } } if ($image && $img) { ?> <div class="aligner" > <?php if ($instance["gallery"] == 'nivo') { $this->post_gallery('nivo', $imgw, $instance["singleh"], $instance["thumbs"], $instance); } else { ?> <?php if ($instance["meta"] == 'bimage') { echo $this->blog_meta($instance); } ?> <?php if ($img) { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> > <img src="<?php echo $imgsrc; ?> " alt="<?php the_title(); ?> " /></a> <?php } ?> <?php if ($instance["gallery"] == 'aimage') { $this->post_gallery('thumbs', $imgw, $instance["singleh"], $instance["thumbs"], $instance); } ?> <?php } ?> <?php if ($instance["meta"] == 'aimage') { echo $this->blog_meta($instance); } ?> </div> <?php } ?> <div> <?php if ($instance["title"] == 'true') { ?> <h2 class="post-header"><a class="post-title" href="<?php the_permalink(); ?> " ><?php the_title(); ?> </a></h2> <?php } ?> <?php if ($instance["meta"] == 'atitle') { echo $this->blog_meta($instance); } ?> <div class="the-post-content"> <?php $retainformat = false; if ($retainformat) { $content = get_the_content_with_formatting(); $content = apply_filters('the_content', $content); echo $content; } else { the_content(); } ?> <?php wp_link_pages(); ?> </div> <?php if ($instance["meta"] == 'atext') { echo $this->blog_meta($instance); } if ($instance["cats"] == 'acontent' && !is_page()) { $_tax = get_the_taxonomies(); if (empty($_tax)) { } else { foreach ($_tax as $key => $value) { preg_match('/(.+?): /i', $value, $matches); $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>'; } } echo '<div class="post-taxonomy">' . join('<br />', $tax) . '</div>'; } ?> </div> </div> <?php //echo get_post_meta($post->ID, 'ultimatum_author', true); if (get_post_meta($post->ID, 'ultimatum_author', true) == 'true') { if (get_the_author_meta('description') && is_multi_author()) { // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> <div id="author-info"> <div id="author-avatar"> <?php echo get_avatar(get_the_author_meta('user_email'), 68); ?> </div><!-- #author-avatar --> <div id="author-description"> <h2><?php printf(esc_attr__('About %s', THEME_LANG_DOMAIN), get_the_author()); ?> </h2> <?php the_author_meta('description'); ?> <div id="author-link"> <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?> " rel="author"> <?php printf(__('View all posts by %s <span class="meta-nav">→</span>', THEME_LANG_DOMAIN), get_the_author()); ?> </a> </div><!-- #author-link --> </div><!-- #author-description --> </div><!-- #entry-author-info --> <?php } } ?> </div> <div class="clearboth"></div> <?php if ($instance['show_comments_form'] == 'true') { comments_template('', true); } } } // end of single or page Main IF for Loop } else { //multi post $colcount = $cols; if ($colcount == 1 && ($colprops[2] == 'ri' || $colprops[2] == 'li' || $colprops[2] == 'gl' || $colprops[2] == 'gr')) { $imgw = $instance[multiplew]; } else { $imgw = $colw; } switch ($colprops[2]) { case 'ri': $align = 'float:right;margin-top:4px;margin-left:15px;'; break; case 'li': $align = 'float:left;margin-top:4px;margin-right:15px;'; break; case 'gl': $align = 'float:left;margin-top:4px;margin-right:15px;'; $rel = 'rel="prettyPhoto[]"'; $gallery = true; break; case 'gr': $align = 'float:right;margin-left:15px;margin-top:4px;'; $rel = 'rel="prettyPhoto[]"'; $gallery = true; break; case 'g': $rel = 'rel="prettyPhoto[]"'; $gallery = true; $align = ''; break; case 'i': $align = ''; break; default: $noimage = true; $align = ''; break; } //Print the Style $styler = ' <style type="text/css"> .ultimatepost{ float:left; width:' . $grid . 'px;'; if (isset($instance['mmargin'])) { $styler .= 'margin-right:' . $instance["mmargin"] . 'px;'; } $styler .= '} .ultimatepost .aligner{ ' . $align . ' } '; if ($responsivetheme) { $styler .= ' @media screen and (min-width:720px) and (max-width: 979px) { .ultimatepost{ float:left; width:100%; margin-right:0; } .ultimatepost .aligner {'; if (isset($align)) { $styler .= $align; } else { $styler .= 'width:100%;'; } $styler .= ' } .ultimatepost .aligner img{ max-width:100%; } } @media screen and (min-width:240px) and (max-width: 719px) { .ultimatepost{ float:left; width:100%; } .ultimatepost .aligner { width:100%; } .ultimatepost .aligner img{ max-width:100%; } }'; } $styler .= '</style>'; echo $styler; if (!have_posts()) { $shownopostsmsg = isset($instance['shownopostsmsg']) ? $instance['shownopostsmsg'] : ''; $nopostsmsg = isset($instance['nopostsmsg']) ? $instance['nopostsmsg'] : ''; if ($shownopostsmsg) { ?> <div id=" <?php echo $widget_id . '-noposts'; ?> class="tricky-dflt-noposts" > <?php echo $nopostsmsg; ?> </div> <?php } } if (have_posts()) { if ($instance["mtitle"] == 'true') { ?> <h1 class="multi-post-title"><?php echo strip_tags(wp_title('', false, 'left')); ?> </h1> <?php } global $wp_query; $paged = get_query_var('paged') && get_query_var('paged') > 1 ? get_query_var('paged') : 1; $args = array_merge($wp_query->query, array('posts_per_page' => $per_page, "paged" => $paged)); query_posts($args); while (have_posts()) { the_post(); global $post; if ($colcount != 1) { //gridd if ($i == 1) { $i++; $gps = false; } elseif ($i == $colcount) { $gps = true; $i = 1; } else { $i++; $gps = false; } } else { $grid = ''; $gps = ''; } //gridd ?> <div class="post post-<?php echo $post->ID; ?> ultimatepost <?php if ($gps) { echo "last"; } ?> "> <div class="post-inner"> <?php $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); if (!$img && $instance["mnoimage"] == 'true') { if (get_theme_option('general', 'noimage')) { $img[0] = get_theme_option('general', 'noimage'); } else { $img[0] = THEME_URI . '/images/no-image.jpg'; } $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["multipleh"], true); } else { $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["multipleh"], true); } if (!$noimage) { $video = get_post_meta($post->ID, 'ultimatum_video', true); $sc = '[video width="100%" height="' . $instance["multipleh"] . '"]' . $video . '[/video]'; if ($imgw != $colw || $instance["mimgpos"] == 'btitle') { ?> <div class="aligner"> <div class="featured-image"> <?php if ($gallery) { if ($video) { $link = $video . ''; } else { $link = $img[0]; } } if ($img) { if ($video && $instance["mvideo"] == 'replace') { echo do_shortcode($sc); } else { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> class="preload <?php if ($gallery) { if ($video) { echo 'image_play'; } else { echo 'image_zoom'; } } ?> " style="position:relative;float:left;padding:0;margin:0;line-height:0px;" > <img src="<?php echo $imgsrc; ?> " style="padding:0;margin:0;line-height:0px;" alt="<?php the_title(); ?> " /> </a> <?php } if ($video && $instance["mvideo"] == 'aimage') { echo do_shortcode($sc); } } ?> </div> <?php if ($instance["mmeta"] == 'aimage') { echo $this->blog_multimeta($instance); } ?> </div> <?php } } if (!$grid) { $wi = $grid_width - ($imgw + 15); echo '<div>'; } else { echo '<div>'; } ?> <h2 class="post-header"> <?php if ($rel) { ?> <?php the_title(); ?> <?php } else { ?> <a class="post-title" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <?php } ?> </h2> <?php if ($imgw == $colw && $instance["mimgpos"] == 'atitle') { ?> <div class="aligner"> <div class="featured-image"> <?php if ($gallery) { if ($video) { $link = $video . ''; } else { $link = $img[0]; } } if ($img) { ?> <?php if ($video && $instance["mvideo"] == 'replace') { ?> <?php echo do_shortcode($sc); ?> <?php } else { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> class="preload"><img src="<?php echo $imgsrc; ?> " alt="<?php the_title(); ?> " /></a> <?php } ?> <?php if ($video && $instance["mvideo"] == 'aimage') { ?> <?php echo do_shortcode($sc); ?> <?php } ?> <?php } ?> </div> <?php if ($instance["mmeta"] == 'aimage') { echo $this->blog_multimeta($instance); } ?> </div> <?php } ?> <?php if ($video && $instance["mvideo"] == 'atitle') { ?> <?php echo do_shortcode($sc); ?> <?php } ?> <?php if ($instance["mmeta"] == 'atitle') { echo $this->blog_multimeta($instance); } ?> <?php if ($instance["excerpt"] == 'true') { ?> <p class="post-excerpt"> <?php echo wp_html_excerpt(get_the_excerpt(), $instance["excerptlength"]); ?> ... <?php if ($instance["mreadmore"] == 'after') { ?> <a href="<?php the_permalink(); ?> " class="readmorecontent" > <span><?php _e($instance["rmtext"], THEME_LANG_DOMAIN); ?> </span> </a> <?php } ?> </p> <?php } elseif ($instance['excerpt'] == 'content') { ?> <p class="post-excerpt"> <?php the_content(); ?> <?php if ($instance["mreadmore"] == 'after') { ?> <a href="<?php the_permalink(); ?> " class="readmorecontent" > <span><?php _e($instance["rmtext"], THEME_LANG_DOMAIN); ?> </span> </a> <?php } ?> </p> <?php } ?> <?php if ($instance["mmeta"] == 'atext') { echo $this->blog_multimeta($instance); } if ($instance["mcats"] == 'acontent') { $_tax = array(); $tax = array(); $_tax = get_the_taxonomies(); if (empty($_tax)) { } else { foreach ($_tax as $key => $value) { preg_match('/(.+?): /i', $value, $matches); $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>'; } } echo '<div class="post-meta taxonomy">' . join('<br />', $tax) . '</div>'; } if ($instance["mreadmore"] != 'false' && $instance["mreadmore"] != 'after') { ?> <p style="text-align:<?php echo $instance["mreadmore"]; ?> "> <a href="<?php the_permalink(); ?> " class="readmorecontent" > <span><?php _e($instance["rmtext"], THEME_LANG_DOMAIN); ?> </span> </a> </p> <?php } ?> </div> </div> </div> <?php if ($i == 1) { echo '<div style="clear:both"></div>'; } } } } // MainIF Finish end multi post echo '<div style="clear:both"></div>'; ?> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> </div> <?php } } }