I have been building a series of theme pages. On one page a users messages (post_type=messages) come in in a tab on the page. The content is displayed in place as is the title etc.... The content is shown again after the closing on the page. There is no that would let that happen in the theme.
Furthermore the post_type=bookings that show up in another tab echo the content correctly. But within that loop is another loop that shows the post_type=items showing the configurations of each booking. It then echoes the last item as another booking.
What the hell is going on.
Any ideas?
Marvellous
---- EDIT ---
The error is due to loops within loops. So we need to use the get_posts function instead of query_posts. I have implemented it like this.
<?php $congigs = get_posts('post_type=items&author='.$current_user->ID.'&tag='.$bkpostid.'&numberposts=-1');
foreach($congigs as $posts) : setup_postdata($posts); ?> <li><?php the_title(); ?></li>
<?php endforeach; ?>
There should be 8 of these posts to get and it does get them, however <? the title ?>
is showing 8 copies of the main title of the entire page, not the item post title.
Any ideas. Thanks,
$posts
to$post
.$post
, i'm not sure why, it's something to do with how the template tags work(but your code will work when using$post
instead of$posts
), try it.