Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Portfolio Small
- *
- * Small portfolio template
- *
- * The "Template Name:" bit above allows this to be selectable
- * from a dropdown menu on the edit page screen.
- */
- get_header(); ?>
- <div id="main_container">
- <!-- IE7 float fix --><!--[if lt IE 7]><span class="iefix">.</span><![endif]-->
- <div class="main">
- <div class="entries_full">
- <div class="entry_full">
- <!-- PORTFOLIO POSTS BEGIN -->
- <?php
- $portfolio_cat = get_option('bb_portfolio_cat');
- if($portfolio_cat == 'Choose a category') {$portfolio_cat = 'portfolio';}
- $temp = $wp_query;
- $wp_query= null;
- $wp_query = new WP_Query('category_name=' . $portfolio_cat . '&orderby=title&order=asc&paged=' . $paged);
- $count = 0;
- $row = 1;
- while ($wp_query->have_posts()) : $wp_query->the_post();
- ?>
- <!-- displays the portfolio posts -->
- <?php $count++; if($count > 4) { $count = 1; $row++; } ?>
- <?php if ($row > 1) {if($count == 1) {echo '<div class="clear"></div>';} ?>
- <?php if($count == 1) {echo '<div class="bar mt0"></div>';}
- } ?>
- <div class="box_quarter <?php if ($row == 1) {echo "mt30";} else {echo "mt20";} ?> overflow<?php if($count == 4) {echo " last";} ?>"><h4 class="portfolio_small"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
- <?php if(get_post_meta($post->ID, 'vimeo_embed_value', true) != NULL) { ?>
- <!-- Vimeo -->
- <?php $vimeo = preg_replace('/\D*(\d+(\.\d+)?)/', "$1", get_post_meta($post->ID, 'vimeo_embed_value', true)); ?>
- <object width="217" height="122"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=<?php echo $vimeo; ?>&server=vimeo.com&show_title=1&show_byline=0&show_portrait=0&color=00ADEF&fullscreen=1&autoplay=0&loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=<?php echo $vimeo; ?>&server=vimeo.com&show_title=1&show_byline=0&show_portrait=0&color=00ADEF&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="217" height="122"></embed></object>
- <?php } else if(get_post_meta($post->ID, 'youtube_embed_value', true) != NULL) { ?>
- <!-- Youtube -->
- <?php
- function my_strip($start,$end,$total){
- $total = stristr($total,$start);
- $f2 = stristr($total,$end);
- return substr($total,strlen($start),-strlen($f2));
- }
- $string=get_post_meta($post->ID, 'youtube_embed_value', true);
- $youtube=my_strip("?v=","&",$string);
- ?>
- <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/<?php echo $youtube; ?>?fs=1&hl=en_US&color1=0x3a3a3a&color2=0x999999" width="217" height="147"><param name="movie" value="http://www.youtube.com/v/<?php echo $youtube; ?>?fs=1&hl=en_US&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param></object>
- <?php } else { ?>
- <div class="mag"><!-- magnifying glass div -->
- <a href="<?php if(get_post_meta($post->ID, 'fullsize_value', true) != NULL){ echo get_post_meta($post->ID, 'fullsize_value', $single = true);} else echo the_permalink(); ?>" <?php if(get_post_meta($post->ID, 'fullsize_value', true) != NULL){echo 'rel="prettyphoto" ';}?>title="<?php the_title_attribute(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php if(get_post_meta($post->ID, 'large_image_value', true) != NULL) {echo get_post_meta($post->ID, 'large_image_value', $single = true);} else {echo get_post_meta($post->ID, 'fullsize_value', $single = true);} ?>&h=217&w=217&zc=1" alt="<?php the_title(); ?>" /></a>
- </div><!-- end magnifying glass div -->
- <div class="portfolio_small"><?php global $more; $more = false; ?><?php the_content(''); ?><?php $more = true; ?></div>
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" class="more-link" style="opacity: 1; margin-top:5px;"><span>Learn More</span></a>
- <?php } ?>
- </div>
- <?php endwhile; ?>
- <div class="clear mt25"> </div>
- <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
- $wp_query = null; $wp_query = $temp; ?>
- <!-- PORTFOLIO POSTS END -->
- </div><!-- end div.entry -->
- </div><!-- end div.entries -->
- <div class="clear"></div>
- </div><!-- end div#main -->
- <div class="clear"></div>
- </div><!-- end div#main_container-->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment