WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] show posts, based similar category as the listed pages category

[Resolved] show posts, based similar category as the listed pages category

  • Hi!

    I want to show posts, that are in a similar category as the listed pages. Here is my code (just the php not the html). What is wrong?

    <?php $pages = get_pages(array('child_of' => 13)); ?>
        <?php foreach ($pages as $page): ?>
            <?php echo $page->post_title; ?>
            <?php echo $page->post_excerpt; ?>
            <?php echo $page->post_content; ?>
                <?php $categories = get_the_category($page->ID);?>
                    <?php query_posts('post_type=projekt&category_name=.$categories.&showposts=1');?>
                        <?php while (have_posts()) : the_post(); ?>
                            <?php the_title(); ?>
        <?php endwhile; endforeach; ?>

    Thanx for the help, I investigate this all the day and i can’t found a solution….

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] show posts, based similar category as the listed pages category’ is closed to new replies.