WordPress.org

Ready to get started?Download WordPress

Forums

Pinboard
Show only last sticky post (2 posts)

  1. infdesist87
    Member
    Posted 1 year ago #

    Hi all,

    I need to show only the last entry sticky.
    The index.php calls get_template_part ('content', get_post_format ()

    If my input is standard, it loads the file content.php

    What code is loading the posts below?
    index.php: http://i.imgur.com/5kFlr.png
    content.php: http://i.imgur.com/a8SLX.png
    homepage: http://i.imgur.com/8R0Pb.png

  2. infdesist87
    Member
    Posted 1 year ago #

    If I change...

    <?php while (have_posts()) : the_post(); ?>
      <?php get_template_part( 'content', get_post_format() ); ?>
    <?php endwhile; ?>

    by

    <?php if (have_posts()) : the_post(); ?>
      <?php get_template_part( 'content', get_post_format() ); ?>
    <?php endif; ?>

    I get what I was looking for. There's another way to do it?
    What consequences may have by change the code directly?

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic