WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display full content of sticky posts on homepage, but excerpts on the rest (3 posts)

  1. jamo_dodger
    Member
    Posted 1 year ago #

    Hello,

    I am editing the content.php file in my 2012 child theme and am using:

    <?php if ( is_front_page() || is_archive() || is_search() ) : // Only display Excerpts for Search, Archive and Home pages ?>

    to display excerpts on my homepage. However at the top of the homepage their is a slideshow sticky post that does not display when using this code.

    I have tried using alchymyths <?php if ( !is_sticky()&&is_home() || is_front_page() || is_archive() || is_search() ) : // Only display excerpts for home, archives and search; but not for stickies on home. ?>

    but it does not work, does anyone know how i can do this?

    James

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    edit content.php in (a child theme of) Twenty Twelve;
    change for instance this line:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>

    to:

    <?php if ( !is_sticky() && is_home() || is_search() ) : // Only display Excerpts for Search ?>

    be aware that some post formats are not using content.php ...

  3. jamo_dodger
    Member
    Posted 1 year ago #

    Thanks alchymyth for your prompt response this worked great.

    James

Topic Closed

This topic has been closed to new replies.

About this Topic