Support » Plugin: Ultimate Member – User Profile, User Registration, Login & Membership Plugin » How to show excerpts of the locked posts using Ultimate Member Plugin

  • Resolved vanshikaverma

    (@vanshikaverma)


    Hello,

    I recently updated Ultimate Member plugin on the site. It got updated to version 2.5.1.

    I have locked my posts using tag restriction and want to show excerpts to the logged out users above the Restriction Access Message.

    Requesting your help for the same.

    Thanks
    Regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @vanshikaverma

    Please try following code snippets:

    add_filter( 'the_content', function( $content ){
    
    if ( current_user_can( 'administrator' ) ) {
    				return $content;
    			}
    
    			$id = get_the_ID();
    			if ( ! $id || is_admin() ) {
    				return $content;
    			}
    
    			if ( UM()->access()->is_restricted( $id ) ) {
    				return get_the_excerpt( $id ).'<br/>'.$content;
    			}
    
    		return $content;
    	
    }, 9999991, 1 );
    Thread Starter vanshikaverma

    (@vanshikaverma)

    Hi @aswingiri,

    Thanks for your help.

    We tried this code but it is not working.

    We want to show excerpts to the public who are not our site users and show full content of the posts to our site users.

    Regards.

    I search solution for this issue too

    Plugin Support andrewshu

    (@andrewshu)

    Hello @vanshikaverma
    Sorry for the late answer. Have you solved this problem?
    Please let me know if you need our help.
    Thank you.

    Plugin Support andrewshu

    (@andrewshu)

    Hi @vanshikaverma

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.