Forums

Calling the_content and the_loop in same page (2 posts)

  1. lindsayanng
    Member
    Posted 1 year ago #

    I am having some issues putting together code that works that displays a page's content AND an excerpt from the most recent blog post.

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    make a page template, and use two loops:

    1.
    normal - i.e. just while(have_posts()): etc

    2.
    either 'get_posts()' with 'foreach' loop
    or
    'query_posts()' with 'if(have_posts()): ...' loop;
    end with 'wp_reset_query()'

    http://codex.wordpress.org/Pages#Page_Templates
    http://codex.wordpress.org/Template_Tags/get_posts
    http://codex.wordpress.org/Function_Reference/query_posts
    http://codex.wordpress.org/Function_Reference/WP_Query#Parameters
    http://codex.wordpress.org/Function_Reference/wp_reset_query

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.