<?php global $data; ?>
<section>
<?php
if(!empty($data['portfolio_title'])) {
?>
<div class="bgtitle"><h2><?php _e($data['portfolio_title'],'line'); ?></h2></div>
<?php } ?>
<ul id="mycarousel">
<?php
if(!empty($data['portfolio_number'])) {
$portfolio_nr = $data['portfolio_number'];
}
else {
$portfolio_nr = -1;
}
$args = array(
'orderby'=> 'post_date',
'order' => 'rand',
'post_type' => 'portfolio',
'posts_per_page' => $portfolio_nr
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post();
$p_icon = get_post_meta($post->ID,'dt_portf_icon',true);
$thumb_ids = get_post_thumbnail_id($post->ID);
$pthumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'portfolio-thumb');
?>
<li>
<?php
$portf_icon = get_post_meta($post->ID,'dt_portf_icon',true);
$thumb_id = get_post_thumbnail_id($post->ID);
// Check if wordpress supports featured images, and if so output the thumbnail
if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) :
?>
<a href="">
<?php the_post_thumbnail('portfolio-thumb'); ?>
</a>
<?php
endif; ?>
<?php // Output the title of each portfolio item ?>
<span class="caption"><a href=""><?php echo get_the_title(); ?></a></span>
</li>
<?php endwhile; wp_reset_query(); } ?>
</ul>
</section>