I founded around on Internet the function I used, so i think it's possible re-use it
.
Before we started, please backup your previous settings.
So... to have your grid view like 1-2-3-3...3 u have to modify (Atahualpa interface):
1. Style & edit CENTER COLUMN->The Loop :
------------------------------------------------------------------------------------------------
<?php
//WordPress Theme: Atahualpa 3.4.1
//Modified by: Adelio Fioritto (
http://www.adeliofioritto.com)
//Abstract: Enable grid view for the Atahualpa theme in 1-2-3 column
//Preview:
http://www.rionero24ore.com
// For the frontpage... start editing here
if ( is_front_page() ) { //check frontpage
$paged = get_query_var('paged'); //retrieve the global page number
$post_numbers=get_query_var('posts_per_page'); //retrieve the global variable 'how many post to show'
?>
<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>
<?php } else { ?>
<?php } ?>
<?php $current_post=$bfa_ata['postcount']; //retrieve the current post number ?>
<?php if ($paged==0) { ?>
<?php if ($current_post==1){?> <div id="new_central_loop"> <?php } ?>
<?php if ($current_post==2){?> <div id="new_central_loop"><div id="new_left_pos_50"> <?php } ?>
<?php if ($current_post==3){?> <div id="new_right_pos_50"> <?php }?>
<?php if ((($current_post-1)%3==0) && ($current_post>3)) {?> <div id="new_central_loop"><div id="new_left_pos_30"> <?php } ?>
<?php if ((($current_post-2)%3==0) && ($current_post>3)) {?> <div id="new_central_pos_30"> <?php } ?>
<?php if ((($current_post-3)%3==0) && ($current_post>3)) {?> <div id="new_right_pos_30"><?php } ?>
<?php } if ($paged!=0){ ?>
<?php if ((($current_post-1)%3==0)) {?> <div id="new_central_loop"><div id="new_left_pos_30"> <?php } ?>
<?php if ((($current_post-2)%3==0)) {?> <div id="new_central_pos_30"> <?php } ?>
<?php if ((($current_post-3)%3==0)) {?> <div id="new_right_pos_30"><?php } ?>
<?php } ?>
<?php //bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<div class="post_footer">
<?php
the_time('j F Y'); ?>
<font style="font-style:italic;"><?php _e('by'); ?> <?php the_author(); ?><br>
<?php edit_post_link('Edit', '', ' '); ?> § <?php comments_popup_link('Nessun Commento', '1 Commento', '% Commenti'); ?></font>
</div>
<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>');?>
<?php /*bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>');*/
if ((($current_post!=1) && ($paged==0)) || ($paged!=0)){
$key="thumbnail";
if(get_post_meta($post->ID, $key, true)):
$inis = get_post_meta($post->ID, $key, true);
else:
$inis = catch_that_image();
endif;
if(!empty($inis)): ?>
<div class="theimage pik" style="background: url(<?php echo $inis; ?>) center top no-repeat; width: 120px; height:90px; border: 1px solid #777;"></div>
<?php endif;
$texter = get_the_excerpt();
if(strlen($texter ) > 500) {
$texter = substr($texter , 0, 500);
}
echo ''.$texter.'[...]';
}
if (($current_post==1)&& ($paged==0)){
echo(the_content());
}
?>
<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
<?php //bfa_post_footer('<div class="post-footer">','</div>'); ?>
<!-- / Post -->
</div>
<?php if ($paged==0) { ?>
<?php if ($current_post==3){?> </div><?php }?>
<?php if ($current_post==2){?> <?php } ?>
<?php if ($current_post==1){?> <?php }?>
<?php if ((($current_post-3)%3==0) && ($current_post>3)) {?> </div> <?php } ?>
<?php }
elseif ($paged!=0) { ?>
<?php if ((($current_post-3)%3==0) ) {?> </div> <?php } ?>
<?php } ?>
<?php if (($current_post==$post_numbers)){?>
<?php }
}
if ( !(is_front_page()) ) {
//original loop
?>
<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php }
// For the other pages... the original loop
else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
<?php } ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
</div><!-- / Post -->
<?php } ?>
2. Style & edit CENTER COLUMN -> Content BELOW the LOOP : add this code at the TOP :
------------------------------------------------------------------------------------------------
<?php
$post_numbers=get_query_var('posts_per_page');
$current_post=$bfa_ata['postcount'];
if (($post_numbers!=$current_post) && (($current_post-3)%3!=0) ){ ?>
</div>
<?php } ?>
3. Add HTML/CSS Inserts -> CSS : Inserts :
------------------------------------------------------------------------------------------------
#new_central_loop {clear:left; overflow:hidden; border-bottom: dashed 1px #cccccc;margin-top:10px;margin-bottom:10px;padding-bottom:10px; }
#new_left_pos_50 {float: left; width:48%; margin-right:2%;margin-top:10px;margin-bottom:10px; }
#new_right_pos_50 {float: left; width:48%; margin-left:2%;margin-top:10px;margin-bottom:10px;}
#new_left_pos_30 {float: left; width:31%; margin-right:2%; margin-top:10px;margin-bottom:10px;}
#new_central_pos_30{float: left; width:30%; margin-left:2%;margin-right:2%; margin-top:10px;margin-bottom:10px;}
#new_right_pos_30 {float: left; width:31%;margin-left:2%;margin-top:10px;margin-bottom:10px;}
.lastimage img, .theimage img, .theright img { border: 1px solid #888;}
.theimage {float: right;margin-left: 10px;}
4. EDITOR -> functions.php : add this function :
------------------------------------------------------------------------------------------------
function catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
// $first_img = bloginfo('template_directory') . "/images/no-image200.jpg";
}
return $first_img;
}
5. Should works... pls tell me if there is some problem so we should fix it
----------------------------------------------------------------------------------------------