• Resolved dlagman

    (@dlagman)


    I apologize if this question has been answered already, but I am setting up a site that displays both public and protected content. When the post is protected the manual excerpts throughout the site is replaced with the following message, “There is no excerpt because this is a protected post.”

    Is there a way (hack or plugin) to still show the excerpt even if the post is protected?

    Any help would be greatly appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter dlagman

    (@dlagman)

    Found the answer! https://www.ads-software.com/support/topic/169520

    My right-hand column wasn’t appearing until I removed the following code from the script:

    function display_excerpt_on_protected_posts($content)
        {
            global $post;
            $replacement_text = $post->post_excerpt;
            $replacement_text = apply_filters('get_the_excerpt', $replacement_text);
            return str_replace('This post is password protected. To view it please enter your password below:',$replacement_text, $content);
        }
        add_filter('the_content','display_excerpt_on_protected_posts', 10);

Viewing 1 replies (of 1 total)
  • The topic ‘Displaying original excerpt on protected posts’ is closed to new replies.