homepage multi-loops (2 posts)

  1. tdblanchard
    Posted 8 years ago #

    Hey gang,
    I'm trying to customize a WP installation for a pro-bono client and had a question about my one-off homepage...
    What I'm trying to do is display the most recent post (1 only), followed by the title and content of a "page".
    I had installed the "Get-A-Post" plug-in, but it turned out to be the culprit in crashing my admin section whenever i would edit anything!
    here's the code I have so far:

    <div id="inside_content">
    				<h1>Alice's Blog</h1>
    				$postslist = get_posts('numberposts=1');
    				foreach ($postslist as $post) :
    					<div class="entry">
    					<h2 class="post_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    					<?php the_content(); ?>
    					<?php the_date(); ?>
    				<?php endforeach; ?>
    				<?php get_a_post(5); ?>
    					<div class="entry">
    					<h2><?php the_title(); ?></h2>
    					<?php the_content(); ?>
    				</div><!-- /#inside_content -->
  2. What's wrong with get_post and get_page?

    $mypage = get_page(5);
    <div class="entry">
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.