Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I display a wordpress page content?

I know this is really simple but it just isn't coming to me for some reason and google isn't helping me today.

I want to output the pages content, how do I do that?

I thought it was this:

<?php echo the_content(); ?> 
like image 983
Dave Avatar asked Mar 28 '11 22:03

Dave


People also ask

How do I get page content in WordPress?

If you need to get the page ID you can easily do this by logging into your WordPress website admin and opening the page, post or custom post type for editing. The page id is visible in the address bar as shown in the screenshot below.

How do I show post content in WordPress?

If you want your posts to show up on the home page and WordPress isn't already doing this for you, here's how you do it. In the WordPress admin, go to Settings > Reading. Find the section called Your homepage displays and select the Your latest posts option. Click the Save Changes button and go back to your home page.

How do I display in WordPress?

Firstly, login to your WordPress admin dashboard, then click on 'Settings > Reading'. Next, select the “Your latest post” option under the 'Homepage displays' settings. After that, click on save changes. This is the easiest method of showing posts on your home page in WordPress.

How do I make all my WordPress posts appear on one page?

List All WordPress Posts on Your Homepage. If you'd like all your posts displayed on your front page along with the content of the posts, you can easily do that by going to the Reading Settings screen (Settings > Reading) and changing the number of posts to show to something more than the number of posts you have.


1 Answers

@Marc B Thanks for the comment. Helped me discover this:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); the_content(); endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?> 
like image 129
Dave Avatar answered Sep 28 '22 08:09

Dave