First full post and the rest reduced with read more option

  • Arlindovsky

    #4647

    I wonder if it’s possible on the first page to present the first full post and the other reduced with the option read more

    Mod

    Kenneth John Odle

    #28784

    This issue came up about a month ago and I don’t think we got any resolution of the topic. I did post some links there to things you might want to try if you have the time:

    https://forum.graphene-theme.com/graphene-support/need-help-with-exerpts

    Anonymous

    #28785

    Could we write a custom excerpt length function… and use conditionals to only call it on the “sticky” post?

    I think the first post would HAVE to be sticky, since I’m not sure there is a conditional to test for if it’s the first post. But, I know we can conditionally test if it is a sticky.

    @arlindovsky, will this first post always be a sticky… or not?

    Mod

    Kenneth John Odle

    #28786

    I think you could control this using an offset for the other posts. That’s how magazine style themes handle it, I believe.

    Admin

    Syahir Hakim

    #28787
    Quote:
    I think the first post would HAVE to be sticky, since I’m not sure there is a conditional to test for if it’s the first post. But, I know we can conditionally test if it is a sticky.

    There is, but not exactly a conditional function. There’s a global variable called $wp_query which contains the current index of posts in a loop, among a whole lot of other things.

    Try doing this in the posts loop to see what value it contains:

    <?php global $wp_query; echo $wp_query->current_post; ?>
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!