Wordpress Double Pages ID inside the Code

I'm working on a theme similar to getBootstrap.com page. The issue I'm facing is:

I'm trying to display specific content in the purple section by using the following:

<?php $recent = new WP_Query("page_id=39"); while($recent->have_posts()) : $recent->the_post();?>
<h1><?php the_title(); ?></h1>
<div class="col-md-4 col-md-offset-4">
<?php the_content(); ?>
<?php endwhile; ?>

The top content are brought from page ID 39 <-- this is a page template, as I will be creating multiple templates to display specific content at the top from other pages as well, if there is another way please help otherwise...

I also have this code after the top content which is the default content page (The default page content from the WordPress WYSIWYG editor).

<?php the_content(); ?> 

But it is getting page ID 39 content.

I want to the page ID I'm in contents at the bottom (white space) beside the page ID 39 in the (purple space).

I hope my question is clear.


Solution Found:

$post = get_post($id); 
$content = $post->post_content;
echo $content;  


Just Used this:

$post = get_post($id); 
$content = $post->post_content;
echo $content;  
Tags: PHP / Wordpress / Themes

Similar questions

Why are double-periods ("..") invalid in a Wordpress image filename?
ms-files.php contains the following code fragment: This code determines whether or not the file can be found. However, it does something that I find... Odd. It removes all double-periods ("..") from the string. Normally, this doesn't matter, but we've had users upload files with two periods in a row (sigh), causing this portion of the code to incor...
Wordpress mysql table double prefixes
Currently working on updating a wordpress website for a client of mine. The wordpress mysql database has double prefixes in it though. The standard wp_ prefix and her own custom prefix for the tables. The custom prefix is currently being used. The wordpress install seems generator by installatron. Is it safe to remove all the wp_ prefixed tables or...
Double or Single Quotes in WordPress Content Conflicting With HTML
so I know about addslashes() and related native PHP functions, but I was surprised that I wasn't able to quickly find a WordPress "catch-all" for this kind of situation, given WordPress' focus on CMS. I'm hoping there is something I can work in to all my metaboxes that solves this problem, as oppose to going in to every save and echo function and a...
WordPress 5.0 - publish page immediately without double-check
I just installed WordPress 5.0 and I'm getting used to the new admin area for publishing posts and pages. I notice that when I press "Publish", I get a "Double-check your settings before publishing." message. How can I disable that so I can just publish with one click, like WordPress 4.x?
How can I prevent the WordPress Importer from munging double-newline paragraph breaks to a single newline?
When you import posts with the standard WP Importer plugin, most users are going to find that it changes the standard paragraph break sequence of \n\n to a single \n. When it comes time to display the post later, this will prevent wpautop() from wrapping consecutive paragraphs in <p>...</p> tags, instead replacing the break between them...
Wordpress returning double values for get_author
I took over a Wordpress site and noticed a weird bug. Despite echoing a single get_author() on posts, the pages are displaying doubles for the author (i.e., AuthorAuthor). Any idea why this may happen?

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.