So, I have a page called "breaking news" and using the custom template t_latest_news.php
<? php if (have_posts ()): while (have_posts ()): the_post (); ?>
<div class = "latest-news" id = "post - <? php the_ID ();?>">
<? php the_content (); ?>
<? php edit_post_link (Edit this page, <p class = "edit-link">, </p>); ?>
</div> <! - /.latest-news ->
<? php endwhile; endif; ?>
I created a page element and put some content on this page. Now I want to show the content in the sidebar. How can i do this?
I tried something like:
<? php include (get_query_template (t_latest_news.php)); ?>
<? php include (TEMPLATEPATH. t_latest_news.php); ?>
<? php get_query_template (t_latest_news.php)?>
<? php get_template_part (t_latest_news.php); ?>
But none of them work. HELP!
<? php query_posts (page_id = 76); ?>
<? php while (have_posts ()) {the_post (); ?>
<h2> <? php the_title (); ?> </h2>
<? php the_content (); ?>
<? php}?>
<? php wp_reset_query (); ?>
It works with "page_id", but not pagename. any idea?
source share