• Resolved ximenavin

    (@ximenavin)


    Hi,

    I need users to log in or create an account before they can register for an event. How can I do that?
    Regards.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey there @ximenavin,

    Thanks for reaching out!

    If you are using Event Tickets along with The Events Calendar, this can be done easily within the tickets settings.

    If you are just using The Events Calendar, this can definitely be done but would require some PHP knowledge. The Themer’s guide would be a great place to start.

    Hope that helps, take care!
    Ed

    Thread Starter ximenavin

    (@ximenavin)

    Hi Ed, thank you for your answer.

    We are using The Events Calendar, I think we need to change something in the single-event.php file. Can you tell me how to start? O were can we find the code?

    Regards,

    • This reply was modified 8 years ago by ximenavin.
    Ed

    (@erishel)

    You could try a snippet like the following to require users to login (this would need to be placed in your functions.php file):

    <?php
    /**
     * Default Events Template
     * This file is the basic wrapper template for all the views if 'Default Events Template'
     * is selected in Events -> Settings -> Template -> Events Template.
     *
     * Override this template in your own theme by creating a file at [your-theme]/tribe-events/default-template.php
     *
     * @package TribeEventsCalendar
     *
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    get_header();
    ?>
    
     <?php if ( is_user_logged_in() ) {?>
    	 
    	<div id="tribe-events-pg-template">
    		<?php tribe_events_before_html(); ?>
    		<?php tribe_get_view(); ?>
    		<?php tribe_events_after_html(); ?>
    	</div> <!-- #tribe-events-pg-template -->
    
    	<?php } else { ?>
    		<p>Please log in to view calendar.</p>
    	<?php } ?>
    
    <?php
    get_footer(); ?>

    This would be a good start and could definitely be tweaked to more suit your needs. I’d also like to point out that one of our other plugins Event Tickets can be configured to do this as well.

    Hope that helps!

    Hey there! This thread has been inactive for a while so we’re going to go ahead and mark it Resolved. Please feel free to open a new thread if any other questions come up and we’d be happy to help. 🙂

    Thanks
    Courtney 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Login mandatory’ is closed to new replies.