• Hi.

    I have created 5 Pages with wordpress. One of the Pages has three columns. In the first column should be the sidebar – no problem. The second column should contain the latest 5 posts from the blog – also ok. But now about the third column: In this column should be always the latest content from two ohter Pages (one of them contains subpages – the three latest subpages should be excerpted and represented) with in this project. How could i realize that? Is there any possibility to do it with The Loop? Should I use rss – is that possible?

    I have not really an idea and would be faithful for every help.

    best wishes,
    pati

Viewing 6 replies - 1 through 6 (of 6 total)
  • Sounds like the 2 other pages, from which you’ll be pulling content, will be the same. Since you know their post id #s, you can use the function get_post($post_id) to get the page content.

    For example:
    $page = get_post($page_id);
    echo $page->post_content;

    should give you the content for page with id of $page_id.

    Thread Starter pati

    (@pati)

    Thanks for reply.

    It works, but it isn’t exactly what I search for. With this construct you don’t have the possibility to excerpt the page content. On the home Page there should only be review about the other Page from this project.

    I guess, the main problem is, that you can’t treat Pages like posts – or do I get something wrong?

    I want to do something similar: display excerpts from pages like they were posts. Why? Because I want to have a dynamically updated list of news clippings that show title, author, download link, etc.

    basically this:

    Welcome to the News Articles about this band
    Longmont Daily Times <-- link to article
    Day & Night Magazine
    April 14, 2006
    "Breath taking"
    by Mark T.R. Donohue
    download - doc (28KB)
    Boulder Weekly <-- link to article
    12-29-2005
    "About Face"
    by Ari Armstrong
    download - doc (29KB)
    Boulder Weekly <-- link to article
    10-06-2005
    "Sexual healing"
    by Ari Armstrong
    download - doc (23KB)

    Basically I want to treat pages like posts. I guess I could just create them as posts, but that would be lame and a pain for my client to have to keep track of. There are many other menus within the site like this, too.

    So far I have this on the parent page, which isn’t working (it gives me posts from one of my categories), but may help:


    <?php $my_query = new
    WP_Query('child_of=20&sort_column=menu_order'); ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <div class="post_wrapper_single">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <?php the_excerpt(); ?>
    </div>
    <?php endwhile; ?>

    Greatness. Thanks.

    So if that’s for one page, how could I write a loop so that it checks for how many pages there are, and then goes and get them one-by-one?

    I don’t know. I think you can’t: Pages are not meant to be shown/displayed in the “multiple posts” view as you can do with posts on index or category or archives.

    (If you are a code wizard, there probably is a way… I have never seen it)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I include content of one Page into another?’ is closed to new replies.