• Hello!

    I have a following problem when I’m trying to create a loop with all previous posts at the bottom of each post.

    Actually, I would like that the loop has the same presentation/design as it apprears on the home page of my site. (my Theme is “OBLIQUE”.)

    I tried to make a copy of the design of the homepage. So, I copied a part of the code from the document index.php into the document single.php , like this:

    <?php if ( have_posts() ) : ?>
    <?php /* Start the Loop */ ?>
    <div id=”ob-grid” class=”grid-layout”>
    <?php while ( have_posts() ) : the_post(); ?>
    <?php
    /* Include the Post-Format-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 Format name) and that will be used instead./

    get_template_part( ‘content’, get_post_format() );
    ?>

    <?php endwhile; ?>
    </div>

    <?php the_posts_navigation(); ?>

    <?php else : ?>

    <?php get_template_part( ‘content’, ‘none’ ); ?>

    <?php endif; ?>

    I put this code just before this:
    </main><!– #main –>
    </div><!– #primary –>

    But the only result that I have is one link to the current post. The loop with all the post does not apprear.

    Could you help me please? Where is the mistake?

  • The topic ‘Problem to create a loop’ is closed to new replies.