• Resolved mrblank

    (@mrblank)


    I’m trying to take content I have in a page and simply output it somewhere else, like in a sidebar, but I’m having trouble figuring out how to do that.

    I tried using the get_posts function with a specific page ID, but I fail to get anything.

    Here’s the code I’m trying:

    <?php
    global $post;
    $myposts = get_posts('include=648');
    foreach($myposts as $post) :
    ?>
    <?php the_content(); ?>
    <?php endforeach; ?>

    Is there a function like get_posts that works with pages?

    The end result I’m trying to achieve is to have my writers be able to edit blocks of content (stored on a page) that we can reuse in various places on our site (like on a sidebar or in the footer). I’d use the Widgets feature, but that doesn’t allow for a visual text editor and these content blocks need to be formatted.

    I was using the Miniblog plug-in to do this, but it is no longer in development and no longer works.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • This would be the easy way: http://guff.szub.net/2005/01/27/get-a-post/

    Thread Starter mrblank

    (@mrblank)

    That did the trick. Thanks. 🙂

    With what happened with the Miniblog plug-in, I’m still a little worried about relying on a plug-in for some core functionality. I need to pour through the Widgets API documentation and figure out how those could work.

    Either have a widget pull the Page content or have a Visual Editor on the text widget.

    I’ve got what I need for now. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pull content from a Page into a Template?’ is closed to new replies.