• Uffe

    (@uffe-kirkegaard)


    Hi,

    My frontpage is showing only excerpts of the posts, and the two first posts showing is sticky-posts..

    My problem is, I can’t get the loop to show the WHOLE content from the two sticky-posts, and the excerpt from all the other posts…

    I have tried to add this code to the loop:

    <?php if(is_sticky()):?>
    	<?php the_content(); ?>
    	<?php endif;?>

    But when adding the above code, now the two sticky posts is showing with the whole content, AND also as an excerpt – two times.

    Anyone know how to make this happen..??

    This is my site: https://uffekirkegaard.dk

    The loop i use is:

    [code moderated - please follow the guidelines https://codex.www.ads-software.com/Forum_Welcome#Posting_Code ]

    Kind regards
    Uffe

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?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. ?>

    (untested)

    Thread Starter Uffe

    (@uffe-kirkegaard)

    Alchymyth..

    Thanks for your quick response..

    unfortunately this code didn’t do the trick. But I can’t figure out why. Because if I do this:

    !is_home() || !is_front_page() ||

    .. then I see the change – then all the posts show all content. (So when used on those two, it has an effect).. but for some strange reason not on the sticky..

    So I guess that the sticky-posts gets “its instructions” from somewhere else..??

    Kind regards
    Uffe

    A bit stale on the thread, but I worked a solution for this in index.php (under a child theme):

    <?php if ( is_sticky() ) : ?>
    <?php the_content(); ?>
    <?php else : ?>
    <?php the_excerpt(); ?>
    <?php endif;?>

    Thread Starter Uffe

    (@uffe-kirkegaard)

    Thanks ganghiss… Will try it ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show all content when Post is sticky – Twenty Ten’ is closed to new replies.