Combine 3 'blogs'
Posted: Fri Jul 27, 2012 6:03 pm
I want to basically have 3 blogs but have one page where the posts from all both are shown. I would think you could do something like:
<?php $projects = get_projects(); foreach ($projects as $project){ ?> <h2><a href="project.php?prid=<?php echo $project['id']; ?>"><?php echo $project['title']; ?></a></h2> <h4>By <?php echo $project['user']; ?> on <?php echo $project['date']; ?></h4> <h4>(<?php echo $project['total_comments']; ?> comments, last comment <?php echo $project['last_comment']; ?></h4> <hr /> <p><?php echo $project['preview']; ?></p> <?php } $announcements = get_announcements(); foreach ($announcements as $announcement){ ?> <h2><a href="announcement.php?aid=<?php echo $announcement['id']; ?>"><?php echo $announcement['title']; ?></a></h2> <h4>By <?php echo $announcement['user']; ?> on <?php echo $announcement['date']; ?></h4> <h4>(<?php echo $announcement['total_comments']; ?> comments, last comment <?php echo $announcement['last_comment']; ?></h4> <hr /> <p><?php echo $announcement['preview']; ?></p> <?php } $tutorials = get_tutorials(); foreach ($tutorials as $tutorial){ ?> <h2><a href="tutorial.php?tid=<?php echo $tutorial['id']; ?>"><?php echo $tutorial['title']; ?></a></h2> <h4>By <?php echo $tutorial['user']; ?> on <?php echo $tutorial['date']; ?></h4> <h4>(<?php echo $tutorial['total_comments']; ?> comments, last comment <?php echo $tutorial['last_comment']; ?></h4> <hr /> <p><?php echo $tutorial['preview']; ?></p> <?php } ?>But I don't want that because it would create something like
- new project
old project
oldest project
- new announcement
old announcement
oldest announcement
- new tutorial
old tutorial
oldest tutorial