如何在PHP中嵌入HTML代码

时间:2013-06-08 07:21:31

标签: php wordpress

 <div class="home-description"> 
 <?php the_content() .
 echo "<a class='read-more' href=".
 echo get_bloginfo('url').
     echo "/about-us>".
 echo "more</a>"
 ?>
 </div>

它无法正常工作!请帮忙......

4 个答案:

答案 0 :(得分:1)

它应该是这样的

 <div class="home-description"> 
 <?php echo the_content() .
 '<a class"mread-more" href="'. 
 get_bloginfo('url') .
      '/about-us">more</a>';
 ?>
 </div>

答案 1 :(得分:1)

<?php
echo<<<_HTML
<a class='read-more' href="somepage.html">More</a>
_HTML;
?>

答案 2 :(得分:1)

我认为这会对你有所帮助:

<div class="home-description"> 
 <?php the_content() ?>
 <a class='read-more' href="<?php echo get_bloginfo('url');?>/about-us>">more</a>
 </div>

答案 3 :(得分:0)

编写此代码

<?php the_content(); ?>
<a href="<?php the_permalink(); ?>">Read more...</a>