WordPress.org

Support

Support » Themes and Templates » Need Help with Triangle Template and get_posts

Need Help with Triangle Template and get_posts

  • Dears,

    I am building this website using Triangle Magazine template and I am having this weird problem that is getting on my nerves. I wanted to make 6 pods on the homepage belonging to 6 categories and wanted to have the latest posts from each show there.

    I did that by writing the following code:

    $post_ids = array(0);
    			foreach( array(9,10,13,14,15,16) as $cat_id ) {
    					if ( $posts = get_posts(array('category' => $cat_id, 'numberposts' => 1)) ) {
    							$first = array_shift($posts);
    							$post_ids[] = $first->ID;
    					}
    			}
    			query_posts(array('post__in' => $post_ids));

    The problem is that the code is displaying Ids though I have no echo anywhere. Please have me out here guys.

    Regards,

    Maddy

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Need Help with Triangle Template and get_posts’ is closed to new replies.