• Resolved tkse

    (@tkse)


    I am building a website with a mostly static homepage and a full display of posts in a different page. However I’d like to display 4-5 posts from the loop on the homepage in a much more minimalistic manner than on the archive page.

    While I have found some alternatives, I’m struggling to find anything that will bring in the full content.php-file. How can I do this? If I simply call the loop from within the page editor it says “No posts” an endless amount of times on the page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Have you reviewed multiple Loops?

    Thread Starter tkse

    (@tkse)

    Got it working somewhat now, however that broke my shortcode.

    This is what I have in the editor now:

    [slider id='14' name='noob']
    <?php dynamic_sidebar( 'secondary' ) ?>
    <div class="clear"></div>
    <?php $my_query = new WP_Query('&posts_per_page=5');
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <?php get_template_part( 'content', get_post_format() ); ?>
      <?php endwhile; ?>

    I am using Exec-PHP plugin to use PHP in editor. Any idea why the slider plugin doesn’t work anymore? Link to site

    Thread Starter tkse

    (@tkse)

    Solved through calling shortcode in PHP.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying 5 posts from loop on page’ is closed to new replies.