Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Help with custom post excerpt display

Discussion in 'Misc WordPress Requests' started by Marius L. J., Dec 5, 2017.

  1. Marius L. J.

    Guest

    Reply To: Help with custom post excerpt display, by Marius L. J.

    Hi,

    This is certainly doable. What I tend to do in these cases is create a variable outside of The Loop, I like to go with $post_number = 1;.

    Now, at the end of The Loop, I put in a $post_number++; this makes the counter go up by one every time we’ve displayed a post (I started it at 1 since we’ll start with the first post).

    At the bit thatdisplays the excerpt, add an IF conditional and check if ( $post_number <= 3 ) { the_excerpt(); }, that will only display the excerpt if you are on post 3 number or earlier.

    Of course, these are rough examples, but should hopefully get you going in the right direction.

    Reply To: Help with custom post excerpt display
     
    #1

Share This Page

Web Hosting