Portfolio

set(‘cat’, implode(‘,’,$cats));
return $query;
}

theme/search.php
global $wp_query;
$num=$wp_query->post_count;

$vars=array_merge($_GET,$_POST);
if(!$cats=$vars[cc]) if($vars[cat]) $cats=array($vars[cat]);
if(count($cats)) {
$list=wp_list_categories(‘echo=0&orderby=name&title_li=&style=none&include=’.implode(‘,’,$cats));
$list=substr($list,0,strrpos($list,’<')); $list=' in '.str_replace('
‘,’, ‘,$list).’. [Search all]‘;
}
*/
global $wp_query;
$vars=array_merge($_GET,$_POST);
//if(!$cats=$vars[cc]) if($vars[cat]) $cats=array($vars[cat]);
if(!$cats=$vars[cc]) die(‘*********************’);
if(!is_array($cats)) die(‘*********************’);
if(count($cats)>10) $cats=array_slice($cats,0,10);

if(!count($cats)) die(‘*********************’);

echo ‘

‘;
echo ‘Following sources selected:
‘;
$list=wp_list_categories(‘echo=0&orderby=name&title_li=&style=none&include=’.implode(‘,’,$cats));
$list=substr($list,0,strrpos($list,’<')); $list=str_replace('
‘,’ | ‘,$list);
echo $list;
echo ‘

‘;

$paged = get_query_var(‘paged’) ? get_query_var(‘paged’) : 1;
$wp_query->query(array(“category__in”=>$cats,’orderby’=>’date’,’order’=>’DESC’, ‘showposts’=>get_option(‘posts_per_page’), ‘paged’=>$paged));
$wp_query->in_the_loop = true;
$x = 1;
if (have_posts()) :
if($paged==1) {
if(get_option(‘uwc_post_layout’) == 1) { include (TEMPLATEPATH.’/layout/option1.php’); }
if(get_option(‘uwc_post_layout’) == 2) { include (TEMPLATEPATH.’/layout/option2.php’); }
if(get_option(‘uwc_post_layout’) == 3) { include (TEMPLATEPATH.’/layout/option3.php’); }
if(get_option(‘uwc_post_layout’) == 4) { include (TEMPLATEPATH.’/layout/option4.php’); }
} else {
if(get_option(‘uwc_post_layout’) == 1) include (TEMPLATEPATH.’/layout/option1.php’);
else include (TEMPLATEPATH.’/layout/default.php’);
}
endif;
$wp_query->init();
?>

Vélemény, hozzászólás?