下面是我的代码工作得很好,但问题是html标记没有出现。。如等。。。不知道为什么。。。
<?php $recent = new WP_Query("page_id=2"); while($recent->have_posts()) : $recent->the_post();?>
<?php
echo substr(get_the_excerpt(), 0,450);
?>
<a href="<?php the_permalink() ?>" rel="bookmark">
More About Us
</a>
下面是另一段代码,它是html标记,一切正常。。但我不知道怎么在那里做permalink。。我放在那里的permalink我不工作。<?php
$my_id = 2;
$page_id = get_post($my_id);
$content = $page_id->post_content;
echo substr($content, 0, 450);
?>
<a href="<?php the_permalink() ?>" >More About Us</a>
还有什么是获得特定页面内容的最佳方式,如bellow方式<h2>title</h2>
<div>featured image </div>
<div>content</div>
<a href="<?php the_permalink() ?>" rel="bookmark">