Wordpress阅读更多不显示帖子的其余部分

时间:2013-12-14 17:21:00

标签: php wordpress

我在帖子中放了一个更多元素,当我点击它时,我的页面上会出现更多元素,但它不显示帖子的其余部分。

<?php
  global $more;
  $more = 0;
?>

<div id="content">

<?php
  query_posts('cat=5');
  while (have_posts()) : the_post();
    $thumb_id = get_post_thumbnail_id();

    $thumb_url = wp_get_attachment_image_src($thumb_id,'full', true);
    echo '<div class="myContent">
    <img class="image" src="'.$thumb_url[0].'" >';

    the_content('<div class="read">READ MORE</div>');
    echo'</div>';
  endwhile;
?>
</div>

1 个答案:

答案 0 :(得分:1)

因为没有指向链接。 应该是这样的:

<?php
  global $more;
  $more = 0;
?>

<div id="content">

<?php
  query_posts('cat=5');
  while (have_posts()) : the_post();
    $thumb_id = get_post_thumbnail_id();

    $thumb_url = wp_get_attachment_image_src($thumb_id,'full', true);
    echo '<div class="myContent">
    <img class="image" src="'.$thumb_url[0].'" >';

    the_content('<div class="read"><a href="<?php the_permalink ?>">READ MORE</a></div>');
    echo'</div>';
  endwhile;
?>
</div>
相关问题