2016-08-01 3 views
0

Ich versuche, nur die vorgestellten Inhalte so nur die Galerie auf der Startseite angezeigt wird, so versuche ich, die Post-Schleife zu deaktivieren, die ich leicht tun kann, aber ich habe Probleme beim Beibehalten der Paginierung beim Entfernen. HierEntfernen Post-Loop auf der Homepage von Twenty Fourteen Wordpress und halten Paginierung

ist der Code

<?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 --> 

würde ich auch versuchen, es in CSS tun

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

Dies ist eine bestimmte Stelle zu entfernen, aber ich will versuchen, alle Beiträge zu entfernen, ohne mit dem vorgestellten Messing Galerie

+0

Möchten Sie die Seitennummerierung beibehalten? Bitte fügen Sie hier Ihre Website-Link –

+0

Dies arbeitete jeder, der das braucht .... – user1576581

Antwort

0

Das funktionierte jeder, der dies braucht ...

<?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. 
        */ 
$xpaged = (get_query_var('paged')) ? get_query_var('paged') : 1; 
global $paged; 

if ($paged > 1) {      
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 --> 
+0

jeder, der nicht geholfen hat, danke für nichts, das ist eine Gemeinschaft, sollten Sie versuchen und helfen, wenn Sie können. – user1576581

Verwandte Themen