2014-11-02 21:47:15 +01:00
|
|
|
<?php
|
|
|
|
function get_page_box($attrs){ ?>
|
|
|
|
<?php
|
|
|
|
global $count2 ;
|
|
|
|
$box_title = "Collettivi/Progetti";
|
|
|
|
if( !empty($attrs['box_title']) )
|
|
|
|
$box_title = $attrs['box_title'];
|
|
|
|
|
|
|
|
$Posts = 12;
|
|
|
|
if( !empty($attrs['num']) )
|
|
|
|
$Posts = $attrs['num'];
|
|
|
|
|
|
|
|
//$page_ids_arr=Array('80','71','16');
|
|
|
|
$page_ids=Array();
|
|
|
|
if( !empty($attrs['ids']) )
|
|
|
|
$page_ids=explode(",",$attrs['ids']);
|
|
|
|
|
2014-11-03 01:41:28 +01:00
|
|
|
$home_layout = '';
|
2014-11-02 21:47:15 +01:00
|
|
|
if( !empty($attrs['layout']) )
|
|
|
|
$home_layout = $attrs['layout'];
|
|
|
|
|
|
|
|
$args=Array(
|
|
|
|
'post_type'=> 'page',
|
|
|
|
'post__in' => $page_ids,
|
|
|
|
'no_found_rows' => 1,
|
|
|
|
'posts_per_page' =>$Posts,
|
|
|
|
'offset'=> '',
|
|
|
|
'orderby' => 'rand'
|
|
|
|
);
|
|
|
|
|
2014-11-03 01:41:28 +01:00
|
|
|
|
2014-11-02 21:47:15 +01:00
|
|
|
$cat_query = new WP_Query($args);
|
|
|
|
|
|
|
|
$count = 0;
|
|
|
|
|
|
|
|
?>
|
|
|
|
<?php if( $home_layout == '2c'): //************** 2C ****************************************************** ?>
|
|
|
|
<?php $count2++; ?>
|
|
|
|
<section class="cat-box column2 <?php if($count2 == 2) { echo 'last-column'; $count2=0; } ?>">
|
|
|
|
<div class="cat-box-title">
|
|
|
|
<h2><?php echo $box_title ; ?></h2>
|
|
|
|
<div class="stripe-line"></div>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<div class="cat-box-content">
|
|
|
|
|
|
|
|
<?php if($cat_query->have_posts()): ?>
|
|
|
|
<ul>
|
|
|
|
<?php while ( $cat_query->have_posts() ) : $cat_query->the_post(); $count ++ ;?>
|
|
|
|
<?php if($count == 1) : ?>
|
|
|
|
<li <?php tie_post_class('first-news'); ?>>
|
|
|
|
<div class="inner-content">
|
|
|
|
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
|
|
|
|
<div class="post-thumbnail">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
|
|
|
|
<?php tie_thumb( 'tie-medium' ); ?>
|
|
|
|
<span class="overlay-icon"></span>
|
|
|
|
</a>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
|
|
|
|
|
|
|
|
<div class="entry">
|
|
|
|
<?php tie_excerpt_home() ?>
|
|
|
|
<a class="more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More »', 'tie' ) ?></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li><!-- .first-news -->
|
|
|
|
<?php else: ?>
|
|
|
|
<li <?php tie_post_class(); ?>>
|
|
|
|
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
|
|
|
|
<div class="post-thumbnail">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php tie_thumb(); ?><span class="overlay-icon"></span></a>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<?php endif; ?>
|
|
|
|
<h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
|
2014-11-04 18:21:43 +01:00
|
|
|
<div class="entry">
|
|
|
|
<?php tie_excerpt_home() ?>
|
|
|
|
</div>
|
2014-11-02 21:47:15 +01:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php endwhile;?>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
</div><!-- .cat-box-content /-->
|
|
|
|
</section> <!-- Two Columns -->
|
|
|
|
|
|
|
|
|
|
|
|
<?php elseif( $home_layout == '1c' ): //************** 1C ****************************************************** ?>
|
|
|
|
<section class="cat-box wide-box">
|
|
|
|
<div class="cat-box-title">
|
|
|
|
<h2><?php echo $box_title ; ?></h2>
|
|
|
|
<div class="stripe-line"></div>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<div class="cat-box-content">
|
|
|
|
|
|
|
|
<?php if($cat_query->have_posts()): ?>
|
|
|
|
<ul>
|
|
|
|
<?php while ( $cat_query->have_posts() ) : $cat_query->the_post(); $count ++ ;?>
|
|
|
|
<?php if($count == 1) : ?>
|
|
|
|
<li <?php tie_post_class( 'first-news' ); ?>>
|
|
|
|
<div class="inner-content">
|
|
|
|
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
|
|
|
|
<div class="post-thumbnail">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
|
|
|
|
<?php tie_thumb( 'tie-large' ); ?>
|
|
|
|
<span class="overlay-icon"></span>
|
|
|
|
</a>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
|
|
|
|
<div class="entry">
|
|
|
|
<?php tie_excerpt_home() ?>
|
|
|
|
<a class="more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More »', 'tie' ) ?></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li><!-- .first-news -->
|
|
|
|
<?php else: ?>
|
|
|
|
<li <?php tie_post_class(); ?>>
|
|
|
|
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
|
|
|
|
<div class="post-thumbnail">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php tie_thumb(); ?><span class="overlay-icon"></span></a>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<?php endif; ?>
|
|
|
|
<h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
|
2014-11-04 18:21:43 +01:00
|
|
|
<div class="entry">
|
|
|
|
<?php tie_excerpt_home() ?>
|
|
|
|
</div>
|
2014-11-02 21:47:15 +01:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php endwhile;?>
|
|
|
|
</ul>
|
|
|
|
<div class="clear"></div>
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
</div><!-- .cat-box-content /-->
|
|
|
|
</section><!-- Wide Box -->
|
|
|
|
|
|
|
|
<?php else : //************** list ********************************************************************************** ?>
|
|
|
|
|
|
|
|
<section class="cat-box list-box">
|
|
|
|
<div class="cat-box-title">
|
|
|
|
<h2><?php echo $box_title ; ?></h2>
|
|
|
|
<div class="stripe-line"></div>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<div class="cat-box-content">
|
|
|
|
|
|
|
|
<?php if($cat_query->have_posts()): ?>
|
|
|
|
<ul>
|
|
|
|
<?php while ( $cat_query->have_posts() ) : $cat_query->the_post(); $count ++ ;?>
|
|
|
|
<?php if($count == 1) : ?>
|
|
|
|
<li <?php tie_post_class( 'first-news' ); ?>>
|
|
|
|
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
|
|
|
|
<div class="post-thumbnail">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
|
|
|
|
<?php tie_thumb( 'tie-medium' ); ?>
|
|
|
|
<span class="overlay-icon"></span>
|
|
|
|
</a>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
|
|
|
|
|
|
|
|
<div class="entry">
|
|
|
|
<?php tie_excerpt_home() ?>
|
|
|
|
<a class="more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More »', 'tie' ) ?></a>
|
|
|
|
</div>
|
|
|
|
</li><!-- .first-news -->
|
|
|
|
<?php else: ?>
|
|
|
|
<li <?php tie_post_class( 'other-news' ); ?>>
|
|
|
|
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
|
|
|
|
<div class="post-thumbnail">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php tie_thumb(); ?><span class="overlay-icon"></span></a>
|
|
|
|
</div><!-- post-thumbnail /-->
|
|
|
|
<?php endif; ?>
|
|
|
|
<h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
|
2014-11-04 18:21:43 +01:00
|
|
|
<div class="entry">
|
|
|
|
<?php tie_excerpt_home() ?>
|
|
|
|
</div>
|
2014-11-02 21:47:15 +01:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php endwhile;?>
|
|
|
|
</ul>
|
|
|
|
<div class="clear"></div>
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
</div><!-- .cat-box-content /-->
|
|
|
|
</section><!-- List Box -->
|
|
|
|
|
|
|
|
<?php endif; ?>
|
2014-11-03 01:41:28 +01:00
|
|
|
<?php } ?>
|