Php 如何在wordpress中创建While循环帖子

Php 如何在wordpress中创建While循环帖子,php,wordpress,Php,Wordpress,你们有没有人试过这个,因为我对它有意见 我有两个文件,一个是index.php,另一个是wordpress文件中的content.php。我试图有一个设计,显示在左边和右边的其他职位。这是密码 code from my index.php --- <?php if (have_posts()): ?><?php //loop through posts $position = 1; while (have_

你们有没有人试过这个,因为我对它有意见

我有两个文件,一个是index.php,另一个是wordpress文件中的content.php。我试图有一个设计,显示在左边和右边的其他职位。这是密码

 code from my index.php --- 


        <?php if (have_posts()): ?><?php
        //loop through posts
        $position = 1;
        while (have_posts()):
            ?>
            <?php the_post(); ?>

            <?php get_template_part('content', _thrive_get_post_content_template($options)); ?>

            <?php if (thrive_check_blog_focus_area($position)): ?>
                <?php if (strpos($options['blog_layout'], 'masonry') === FALSE && strpos($options['blog_layout'], 'grid') === FALSE): ?>
                    <?php thrive_render_top_focus_area("between_posts", $position); ?>
                    <div class="spr"></div>
                <?php endif; ?>
            <?php endif; ?>

            <?php
            $position++;
        endwhile;
        ?>
来自my index.php的代码--
这是my content.php中代码的第二部分

<li class="post <?php $array = array( "post-r", "post-l"); foreach( $array as $value ) {echo "$value";} ?> post-single">
<?php tha_entry_top(); ?>
<?php if ($options['featured_image_style'] == "wide" && $featured_image && $post_format != 'gallery' && $post_format != 'video'): ?>
<a href="<?php the_permalink(); ?>"> 
        <img class="lazy" data-orginal="<?php echo $featured_image; ?>" width="460" height="277" src="<?php echo $featured_image; ?>" alt="<?php echo $featured_image_alt; ?>" title="<?php echo $featured_image_title; ?>" style="display:block;">
        <noscript>&lt;img src="<?php echo $featured_image; ?>" width="460" height="277" alt="<?php the_title(); ?>"&gt;</noscript>
    <?php endif; ?>

    <h2 class="title"><?php the_title(); ?></h2>

    <?php if (isset($options['display_meta']) && $options['display_meta'] == 1): ?>
    <div class="details">
    <?php if (isset($options['meta_post_date']) && $options['meta_post_date'] == 1): ?>
    <p class="date"><?php echo $post_date; ?></p> <?php endif; ?>
    <p class="shares-comments">
    <span class="shares">278 shares</span>

    <span class="comments"><?php if ($options['meta_comment_count'] != 1 || get_comments_number() == 0): ?><?php echo get_comments_number(); ?><?php endif; ?> comments</span>

    </p>
    </div>
    <?php endif; ?>

如果我完全理解您的意思,您希望使用两列布局显示帖子吗?对吗?你可以称之为专栏,但基本上我希望下一篇博客文章从左开始,从右开始时,一篇在右边,另一篇在右边。就像一个时间表