Hello friends, I have a small problem with getting the content from the pages in WordPress.
In my admin panel I have created some pages, also I have created a custom template and now when I want to open any of the pages then the content is not displayed (the content is empty). Only "Hello World" page works great (FrontPage or ?p=1), but the other pages (?p=4, ?p=6...) in admin panel have a content, but when I try to open in my website then the pages are without content (the content is empty).
For getting the content I use this function:
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
global $post;
echo nl2br($post->post_content);
// I tried with the_gontent() but I got the same problem.
?>
<?php endwhile; ?>
<?php endif; ?>
How can I solve this problem ?
Thanks.