In category and get_posts(offset=X)
-
Using get_posts i want to show different offset depending on wich category the post is.
+++ How do i change this code
<?php
$posts = get_posts(‘numberposts=5’);
foreach($posts as $post) :
setup_postdata($post);?>
<?php endforeach; ?>+++ To something like that?:
<?php if ( in_category(5) ) {?>
get_posts(offset=1);<?php if ( in_category(7) ) {?>
get_posts(offset=2);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘In category and get_posts(offset=X)’ is closed to new replies.