Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress代码内的双页ID_Php_Wordpress_Themes - Fatal编程技术网

Php Wordpress代码内的双页ID

Php Wordpress代码内的双页ID,php,wordpress,themes,Php,Wordpress,Themes,我正在研究一个类似于getBootstrap.com页面的主题。我面临的问题是: 我尝试使用以下命令在紫色部分显示特定内容: <?php $recent = new WP_Query("page_id=39"); while($recent->have_posts()) : $recent->the_post();?> <h1><?php the_title(); ?></h1> <br> <div class="co

我正在研究一个类似于getBootstrap.com页面的主题。我面临的问题是:

我尝试使用以下命令在紫色部分显示特定内容:

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


顶部内容来自页面ID 39刚才使用的内容:

<?php 
$id=39; 
$post = get_post($id); 
$content = $post->post_content;
echo $content;  
?>


在答案部分发布您的解决方案,并接受它。谢谢!我做到了,等了11个小时,这样我就可以接受了。:)
<?php 
$id=39; 
$post = get_post($id); 
$content = $post->post_content;
echo $content;  
?>
<?php 
$id=39; 
$post = get_post($id); 
$content = $post->post_content;
echo $content;  
?>