ها ملف search.php
\[code\]<?php
get\_header();
if (have\_posts()) {
$sidati\_posts = array();
$i = 0;
while(have\_posts()) {
the\_post();
switch ($i%3) {
case 0 :
$sidati\_posts\[1\]\[\] = $post;
break;
case 1:
$sidati\_posts\[2\]\[\] = $post;
break;
default:
$sidati\_posts\[3\]\[\] = $post;
break;
}
$i++;
}
rewind\_posts();
rewind\_posts();
?>
<div class="pagetitle">Search Result for <?php
$allsearch = &new WP\_Query("s=$s&showposts=-1");
$key = wp\_specialchars($s, 1);
$count = $allsearch->post\_count;
\_e('');
\_e('“');
echo $key;
\_e('”');
\_e(' — ');
echo $count . ' ';
\_e('articles');
wp\_reset\_query();
?></div>
<div class="posts"><span class="sep1"></span><span class="sep2"></span><?php
foreach (array\_values($sidati\_posts) as $index => $column) {
?><ul class="mcol col-<?php echo $index ?>"><?php
foreach ($column as $\_post) {
$post = $\_post;
setup\_postdata($\_post);
?><li class="article">
<?php
if ( has\_post\_thumbnail() ) { ?>
<?php
$imgsrcparam = array(
'alt' => trim(strip\_tags( $post->post\_excerpt )),
'title' => trim(strip\_tags( $post->post\_title )),
);
$thumbID = get\_the\_post\_thumbnail( $post->ID, 'background', $imgsrcparam ); ?>
<div><a href=""<?php">" class="preview"><?php echo "$thumbID"; ?></a></div>
<?php } ?>
<h2><a href=""<?php">" title="<?php the\_title(); ?>"><?php the\_title(); ?></a></h2>
<?php the\_excerpt(); ?>
<div class="postmetadata">
Posted: <?php the\_time(\_\_('F jS, Y', 'kubrick')) ?> ˑ
<?php comments\_popup\_link(\_\_('No Comments'), \_\_('1 Comment'), \_\_('% Comments'), '', \_\_('Comments Closed') ); ?><br />
<?php printf(\_\_('Filled under: %s'), get\_the\_category\_list(', ')); ?>
</div>
<?php
}
?><?php
}
?></div><div id="nav">
<div id="navleft"><?php next\_posts\_link(\_\_('Previous page ')) ?></div>
<div id="navright"><?php previous\_posts\_link(\_\_('Next page ')) ?></div>
</div><?php
} else {
?><h1 id="error"><?php \_e("Sorry, but you are looking for something that isn’t here."); ?></h1><?php
}
get\_footer();
?>\[/code\]