Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] How to show contact form 7 only to the logged in users?

  • Resolved utpalpaul

    (@utpalpaul)


    Hello All,

    I am working with contact form 7, nice plugin. But I have an issue, I am using contact form 7 into my template file so that it is visible to all post, its working fine, but I want that the form should only visible if the user is logged in & for non-members there will be a message with a link to register or login page.

    Can anybody please help me out in this?

    Thanks 🙂

    http://wordpress.org/extend/plugins/contact-form-7/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    <?php
    
    if ( is_user_logged_in() )
    	echo do_shortcode( '[contact-form-7 id="1234" title="Contact form 1"]' );
    
    ?>

    Put this code into the template file. Of course you need to change the contact-form-7 shortcode to yours.

    Thread Starter utpalpaul

    (@utpalpaul)

    Thanks a lot 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Contact Form 7] How to show contact form 7 only to the logged in users?’ is closed to new replies.