I wanna pull the data from this area “see the red area on the image below”
Out to a specific template
I have a page template named page.php
<div class="contentholder">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', false ); ?>
<?php endwhile; // end of the loop. ?>
<br />
</div>
but this just send me a comment field.. i need the text in the page
and i need the header
While inside a query loop, this function will output the current posts title:
This function will output the content:
What I suspect has happened however is that you are instead calling
get_template_part( 'content', 'page' );
and expecting it to output the content for the page, when what it’s actually doing is checking if there’s acontent-page.php
, and including it if it’s present, if not it checks forcontent.php
and includes that, and because neither exist, it’s doing nothing, and so you get no content.For more details on what
get_template_part
actually does, look here:http://codex.wordpress.org/Function_Reference/get_template_part
EDIT*
Working snippet: