最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

posts - Blog page not working

programmeradmin0浏览0评论

I'm working on a WordPress theme. I'm using Elementor as my page builder. I have created some Elementor elements for my theme.

but the problem is when I create a page and select it as my post page not post appear on the page. but if I deactivate the Elementor plugin I can see all of my posts.

Code snippet of my index.php

<?php
/**
 * The main template file
 * @link /
 * @package bmaker
 */

get_header();
?>

<!--  Breadcrumbs Start -->
<?php
if ( ! is_front_page() ) {
    get_template_part( 'template-parts/breadcrumbs/breadcrumb-noTitle' );
}
?><!--  breadcrumbs End -->
<?php
if ( ! empty( bmakerThemePanelValue( 'bmaker_layout' ) ) ) {
    $bmkr_container = bmakerThemePanelValue( 'bmaker_layout' );
} else {
    $bmkr_container = 'container';
}
?>
    <!-- Blog Area Start -->
    <div class="blog-details-area blog-grid-area">
        <div class="<?php echo esc_attr( $bmkr_container ); ?>">
            <div class="row">
                <div class="col-xl-8 col-lg-8">
                    <div class="blog-grid">
                        <?php
                        if ( have_posts() ) :

                            if ( is_home() && ! is_front_page() ) :
                                ?>
                                <header>
                                    <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
                                </header>
                            <?php
                            endif;

                            /* Start the Loop */
                            while ( have_posts() ) :
                                the_post();

                                /*
                                 * Include the Post-Type-specific template for the content.
                                 * If you want to override this in a child theme, then include a file
                                 * called content-___.php (where ___ is the Post Type name) and that will be used instead.
                                 */
                                get_template_part( 'loop-templates/content', get_post_type() );

                            endwhile;
                        else :
                            get_template_part( 'template-parts/content', 'none' );
                        endif;
                        ?>
                    </div>

                    <?php
                    get_template_part( 'template-parts/blog/pagination' );
                    ?>
                </div>


                <div class="col-xl-4 col-lg-4">
                    <?php
                    if ( is_active_sidebar( 'right_sidebar' ) ) {
                        dynamic_sidebar( 'right_sidebar' );
                    }
                    ?>
                </div>


            </div>
        </div>
    </div>
    <!-- Blog Area End -->

<?php
get_footer();

Please let me know how can I overcome the problem.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论