2016-08-01 5 views
0

갤러리에서 홈페이지 만 볼 수 있도록 게시물 내용을 계속 유지하려고하므로 쉽게 할 수있는 포스트 루프를 사용하지 않으려 고합니다. 제거 할 때 페이지 매김을 유지하는 데 어려움이 있습니다. 여기 2014 년 Wordpress의 홈페이지에서 포스트 루프를 제거하고 페이지 매기기를 유지하십시오.

<?php 
    if (is_front_page() && twentyfourteen_has_featured_posts()) { 
     // Include the featured content template. 
     get_template_part('featured-content'); 
    } 
?> 

    <div id="primary" class="content-area"> 
     <div id="content" class="site-content" role="main"> 

     <?php 
      if (have_posts()) : 
       // Start the Loop. 
       while (have_posts()) : the_post(); 

        /* 
        * Include the post format-specific template for the content. If you want to 
        * use this in a child theme, then include a file called called content-___.php 
        * (where ___ is the post format) and that will be used instead. 
        */ 
        get_template_part('content', get_post_format()); 

       endwhile; 
       // Previous/next post navigation. 
       twentyfourteen_paging_nav(); 

      else : 
       // If no content, include the "No posts found" template. 
       get_template_part('content', 'none'); 

      endif; 
     ?> 

     </div><!-- #content --> 
    </div><!-- #primary --> 

나는 또한 CSS

.home .post-37401 { 
display: none; 
} 

이 특정 게시물을 제거하는 것입니다에 그 일을 시도 할 것입니다 코드입니다하지만 난 기능을 갖춘 덤비는없이 모든 게시물을 삭제하려고 할 갤러리

+0

페이지 매김을 유지 하시겠습니까? 여기에 귀하의 웹 사이트 링크 –

+0

을 붙여주십시오. 이걸 필요로하는 사람은 누구든지 ... – user1576581

답변

0

이 작업은이 작업을 필요로하는 사람에게 효과적이었습니다 ...

+0

아무에게도 감사의 도움을주지 않은 사람은 누구나 할 수있을 때 도움을 청하는 것이 좋습니다. – user1576581

관련 문제