2014-11-21 3 views
0

새 wordpress 사이트를 만들었습니다. 단일 게시물보기에서 이전 및 다음 단추가 다른 단일 게시물을 탐색하기를 원합니다. 여기 내가 사용하고있는 single.php 페이지 코드가있다.wordpress에서 단일 게시물 탐색

<?php get_header(); ?> 
<?php the_title(); ?> 

<div class="news_article_holder"> 
    <div class="news_art_cont"> 
     <ul id="anyslider"> 
      <?php if(have_posts()) : ?> 
      <?php while (have_posts()) : the_post(); ?> 
      <li> 
       <div class="news_art_1"> <a href="<?php the_permalink(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/star.png" width="60px" class="news_star" alt=""> 
        <h1> 
         <?php the_field('news_title'); ?> 
        </h1> 
        </a> <img src="<?php the_field('news_image_large'); ?>" alt=""> 
        <section> 
         <?php the_content(); ?> 
        </section> 
       </div> 
      </li> 
      <?php endwhile; ?> 
      <?php else : ?> 
      <h3> 
       <?php _e('404 Error&#58; Not Found'); ?> 
      </h3> 
      <?php endif; ?> 
     </ul> 
    </div> 
</div> 

<!--news_article_holder ends here--> 

<?php get_footer(); ?> 
+0

다음 기준은 무엇입니까? 다음 날짜에? 다음 내부 날짜 범주에? – nunorbatista

답변

0

잘 설명되어있는 WordPress codex을 살펴보십시오.

그들을 만들 수있는 몇 가지 옵션이 있습니다, 그 중 하나는 당신이 그것을 (herehere 문서화를) 원하는

<?php previous_post_link(); ?>  

또는

<?php next_post_link(); ?> 

곳을두고하는 것만 큼 쉽습니다.

+0

하지만 단일 게시물보기에서는 작동하지 않습니다. – user3396867

+0

여기 내가 시도한 것

next
user3396867

+0

그냥 기본 예제'go? '그리고 거기에서 너의 길을. – Bjoern

관련 문제