• Hi,
    I’m having trouble setting up a front page for my website where there would be:
    1) a static part (5-10 lines introduction)
    and
    2) a dynamic listing of latest posts plus snippets

    How do I go about doing this?

    Phil

Viewing 1 replies (of 1 total)
  • basically, you could add this static part to index.php before the loop.

    or set a page as front page and make a page template for this page:
    with two loops:
    first: the ‘normal’ loop showing whatever you put into your page in the editor (5 – 10 lines of introduction);
    second: query_posts() for the latest posts with whatever you want to show with the loop;

    http://codex.wordpress.org/Pages#Page_Templates
    http://codex.wordpress.org/Function_Reference/query_posts

    framework, for instance:

    <?php if (have_posts()) :
       while (have_posts()) :
          the_post();
          the_content(); //shows your lines of intro
       endwhile;
    endif;
    
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('posts_per_page=10&cat=0$paged='.$paged);
    
    if (have_posts()) :
       while (have_posts()) :
          the_post();
          the_title(); //shows the recent posts and snippets
          the_excerpt();
       endwhile;
    endif;
Viewing 1 replies (of 1 total)

The topic ‘Dynamic content on a static front page’ is closed to new replies.