in_category returns error
-
Warning: Invalid argument supplied for foreach() in /var/www/html/wordpress/wp-includes/template-functions-category.php on line 393
and
Warning: in_array(): Wrong datatype for second argument in /var/www/html/wordpress/wp-includes/template-functions-category.php on line 397I want to get only those posts displayed that are in a certain category (before i’ve already selected posts from certain time range). I’m using that kind of loop:
<?php if($my_posts) : foreach($my_posts as $post) : setup_postdata($post); ?>
<?php if(in_category(’11’)) { ?>
//displays posts
<?php } ?>
<?php endforeach; endif; ?>what could be the problem? i haven’t edited my template-functions-category.php file.
The topic ‘in_category returns error’ is closed to new replies.