I tried that, but am not able to get it to work.
<?php
//return sticky posts in categories 3 and 7
query_posts(array(
'post__in'=>get_option('sticky_posts'),
'cat'=>'3,7'
));
if (have_posts()) : while (have_posts()) : the_post();
?>
thanks raskull.
I edited some parts
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$sticky=get_option('sticky_posts');
$args=array(
'cat'=>232,
'caller_get_posts'=>1,
'post__in' => $sticky,
'paged'=>$paged,
);
query_posts($args); while ( have_posts() ) : the_post() ?>
Wanted to know, isn’t there any way for the cat number to autofill, like if the user in on the autos category it is filled as autos
Tell me more about how/where you plan to use this…
i will be having a classified theme (study related)
where there be categories like
– ACCA
– O Levels
– A Levels
– Matriculate
– Intermediate
etc.
If the user visits acca, the sticky posts of ACCA be shown.
If he visits o levls, the sticky from that category is posted.
and so on.
Again thankyou
Do you have a file named category.php? That might go a long way towards what you’re looking for. It’s what results if you click a category link (if you have category.php, otherwise it moves on to archive.php). Take a look in archive.php to see what’s going on — you only need the part related to category to put in your category.php file.
http://codex.ww.wp.xz.cn/Template_Hierarchy
http://codex.ww.wp.xz.cn/Category_Templates
My point is — category.php already knows what category to display because it came from a category link. Let me know if that doesn’t help!