Is there a way to query_post within a category? Show all post in a category then query those posts?
try this:
<?php
$posts = get_posts('numberposts=6&category=2');
foreach($posts as $post) :
?>
<div class="Box"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a><small><?php the_time('F jS, Y') ?></small></div>
<?php endforeach; ?>
change nr post 6 and category=2 to your wish, the code show 6posts in cat2
cheers
Hi, I would like to know how it will be possible to display archives list sorted by Category and filtered by Another Category and post listed by date within this part. I would like to display this in one category/archive page like this’
‘Food’ (categroy A)
‘After 4 month’ (Category B)
date : Post Tittle(+permalink)
date : Post Tittle(+permalink)
…
‘After 5 month’ (Category C)
date : Post Tittle(+permalink)
date : Post Tittle(+permalink)
…
‘After 6 month’ (Category D)
date : Post Tittle(+permalink)
date : Post Tittle(+permalink)
…
etc
Note ‘After 4 month’ is a category not a date.
Thanks in advance for your previous help.
S
I’m working on this king of stuf but I’m not a coder :`<?php
$posts = get_posts(‘numberposts=6&category=12’);
foreach($posts as $post) :
?>
<div class=”Box”>” title=”<?php the_title(); ?>”><?php the_title(); ?><small><?php the_time(‘ j F Y’) ?></small></div>
<?php endforeach; `?> thanks for your help guys. s
My solution : hope this helps,
br
s
<?php $temp_query = $wp_query; ?>
<?php query_posts(‘cat=1,15’); ?>
<?php while(have_posts()) : the_post(); ?>
<!– <?php the_title(); ?> –>
<div class=”Box”>” title=”<?php the_title(); ?>”><?php the_title(); ?><small><?php the_time(‘ j F Y’) ?></small></div>
<?php endwhile; ?>
<?php $wp_query = $temp_query; ?>