Forums

Show the excerpt even though the post is password protected (2 posts)

  1. ilana.mullin
    Member
    Posted 1 year ago #

    My title says it all. I have a thumbnail gallery that uses the title and the excerpt overlaid on a picture. I still want the excerpt to be displayed because it shows clarifying info, it's just the post that needs to be hidden. And i hate the the default text that shows up for the_excerpt when the post is protected. Here's the code:

    <?php if (post_password_required($post)) { ?>
    <div id="gal_preview">
    <?php the_post_thumbnail(); ?>
    <h4><?php the_excerpt(); ?></h4>
    </div>
    <?php } else {
    the_excerpt();
    } ?>
  2. elfin
    Moderator
    Posted 1 year ago #

    I don't know if it still works as I haven't updated it, but you could have a look at:password protect enhancement
    . If it doesn't work it should give you a starting point at least to achieve it.

Topic Closed

This topic has been closed to new replies.

About this Topic