Trying to show all posts in category -> Invalid argument supplied for foreach()
-
<?php $all_cats = wp_list_categories('hide_empty=0&title_li=&child_of=4'); foreach( $all_cats as $cat ) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?>
What I’m trying to do is to show ALL needed categories with IT’S posts …
But I’m stuck with this code … it shows all cats that i need, but in the end of it I see an Error:Warning: Invalid argument supplied for foreach() in K:\home\test1.ru\www\wp-content\themes\artel\header.php on line 78
Can somebody give me a right solution for this ?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Trying to show all posts in category -> Invalid argument supplied for foreach()’ is closed to new replies.