Pull content from a Page into a Template?
-
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!
- The topic ‘Pull content from a Page into a Template?’ is closed to new replies.