Php 删除214 Wordpress主页上的post循环并保持分页

Php 删除214 Wordpress主页上的post循环并保持分页,php,wordpress,Php,Wordpress,我试图只保留特色内容,所以只有画廊是显示在主页上,所以我试图禁用后循环,我可以很容易地做到,但我有麻烦保持分页时删除它 这是密码 <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' );

我试图只保留特色内容,所以只有画廊是显示在主页上,所以我试图禁用后循环,我可以很容易地做到,但我有麻烦保持分页时删除它

这是密码

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

这是为了删除一个特定的帖子,但我想尝试删除所有帖子,而不影响特色画廊

这对任何需要它的人都有效

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


这对任何需要它的人都有效

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


是否只保留分页?请将您的网站链接粘贴到这里,这对任何需要此链接的人都有效…您想继续分页吗?请将你的网站链接粘贴到这里,这对任何需要帮助的人都有效……每个没有帮助的人都应该无缘无故地感谢,这是一个你应该尽力帮助的社区。每个没有帮助的人都应该无缘无故地感谢,这是一个你应该尽力帮助的社区。