Single page event restriction

Home Forums Calendar Products Events Calendar PRO Single page event restriction

  • This topic has 1 reply, 2 voices, and was last updated 8 years ago by graphisterie02.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1502865
    graphisterie02
    Participant

    Hello,

    Is it be possible to make the content of an event only visible for members who are logged in ?

    Thanks for you help.

    Best regards,

    Yoan

    #1504835
    Barry
    Member

    Hi there @graphisterie02,

    That’s definitely possible. Please do familiarize yourself with our Themer’s Guide in the first instance, which covers some of the basics in relation to customizing The Events Calendar 🙂

    There are a few ways to tackle this, but a fairly easy approach would be to use a template override. In this case, that would mean locating the following template file:

    the-events-calendar/src/views/single-event.php

    Then copying it to your theme:

    YOUR-THEME/tribe-events/single-event.php

    Within that copy, you will see some code like this:

    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }

    Right after that, you could add something like:

    if ( ! is_user_logged_in() ) {
    	echo 'Content available only when logged in';
    	return;
    }

    Perhaps that would work for you?

    #1522196
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Single page event restriction’ is closed to new replies.