showing pages within posts
-
i am putting a page list based on category onto posts, different page lists on different posts, which the code below does:
<? if (is_page('7')) { ?>
<? $posts = get_posts('order=DESC&category=1'); foreach ($posts as $post): ?>
<? the_title(); ?>
<? endforeach; ?>
this however ONLY works if there are pages in that category, if there’s no there’s an error. how do i make it conditional to there being pages within the category? so if there are pages (one or more) then it shows them, if there’s no pages posted in the category it posts nothing?
any help would be appreciated.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘showing pages within posts’ is closed to new replies.