• Janko

    (@janko)


    Hi,
    I’m using static front page and another page for posts.

    I would like to have on the same page (the page with posts):
    – loop with posts (normal in this case)
    – content of this page

    In practice:
    Page starts with some static content and then comes posts.

    I have used two loops on one page before but never on “main” page – nothing I have tried has worked for me ?? …
    Could somebody give me example of it?

    Best regards,
    Janko

Viewing 2 replies - 1 through 2 (of 2 total)
  • js09

    (@js09)

    im also wondering this

    Hi! I’m totally lame at PHP but stumbled on this–hope it helps.

    <div id="main">
    <!-- This section shows the page content, editable through the admin interface -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1><?php the_title(); ?> Page Content</h1>
    <?php the_content('<p class="serif">Read the rest of this page ?</p>'); ?>
    <?php endwhile; endif; ?>
    <!-- This section shows category posts, which can be limited as to number, just edit the category number and showposts number -->
    
     <?php $wp_query = $temp_query; ?>
     <?php query_posts('cat=17&showposts=2'); ?>
     <h1 style="border-bottom: none;">Your category posts</h1>
     <?php while (have_posts()) : the_post(); ?>
     <div class="post" id="post-<?php the_ID(); ?>">
     <p><?php the_content(); ?></p>
     <?php endwhile; ?> </div>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Content and posts on the same page’ is closed to new replies.