Php Wordpress代码内的双页ID
我正在研究一个类似于getBootstrap.com页面的主题。我面临的问题是: 我尝试使用以下命令在紫色部分显示特定内容: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
<?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;
?>