Support

Account

Home Forums General Issues Showdown content if current user.. Reply To: Showdown content if current user..

  • so I guess you have to check if user must join in events loop
    not in calendar

    remove all my var_dump functions and change your code

    <?php $current_user = wp_get_current_user(); ?>
    <?php global $user_login;
          get_currentuserinfo(); ?>
    <?php $lookforuser = get_field('mustjoin'); ?>
    <?php if (strpos($lookforuser, $user_login) !== false) { ?>
        <?php while ($day['events']->have_posts()) : $day['events']->the_post() ?>
        <?php tribe_get_template_part('month/single', 'event') ?>
        <?php endwhile; ?>
    <?php } ?>

    to

    <?php $current_user = wp_get_current_user(); ?>
    <?php global $user_login;
          get_currentuserinfo(); ?>
    <?php while ($day['events']->have_posts()) : $day['events']->the_post(); ?>
       <?php $lookforuser = get_field('mustjoin'); ?>
       <?php if (strpos($lookforuser, $user_login) !== false) 
             tribe_get_template_part('month/single', 'event'); ?>
    <?php endwhile; ?>