WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Entire single sticky post on homepage with excerpts (4 posts)

  1. thecolonialist
    Member
    Posted 4 years ago #

    I have my homepage set up so that all the posts are displayed with their intro text and then a "read more" button. However, I have one sticky post at the top that I'd like to display in its entirety, while maintaining the "read more" system with all other posts. Is there any way to do this? Forgive me if there's something I could have found before posting this. I tried searching, but it's sort of a tough issue to find the right keywords for.

  2. MichaelH
    Member
    Posted 4 years ago #

    <?php
    if (is_sticky()) {
      global $more;    // Declare global $more (before the loop).
      $more = 1;       // Set (inside the loop) to display all content, including text below more.
      the_content();
    } else {
      global $more;
      $more = 0;
      the_content('Read the rest of this entry &raquo;');
    }
    ?>
  3. thecolonialist
    Member
    Posted 3 years ago #

    Awesome! Thanks!

  4. mastro_
    Member
    Posted 3 years ago #

    Hi,
    same issue, where i have to put this code?
    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic