Password Protected Pages Excerpt

<?php
function site_admin_excerpt( $excerpt ) {
    if ( post_password_required() )
    {
        $excerpt = 'This is a private page to request the password please contact the site administrator.';
    }

    return $excerpt;
}
add_filter( 'the_excerpt', 'site_admin_excerpt' );
?>
The following two tabs change content below.

Md Jahed

Latest posts by Md Jahed (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *