Support » Plugin: PilotPress » “not_any” Not working

  • The shortcode “not_any” shows even if logged in and has the listed member level.

    <section class="courses">
    	<div class="container">
    	
    	 <?php //FOR TESTING
    		echo do_shortcode('[show_if has_one="Bliss Habit E-Course Lifetime"]<p style="color:red;font-weight:700;text-align:center;">IF YOU SEE THIS YOU ARE LOGGED IN AS A BLISS HABIT MEMBER</p>[/show_if]');
    		echo do_shortcode('[show_if has_one="Body + Soul Membership"]<p style="color:red;font-weight:700;text-align:center;">IF YOU SEE THIS YOU ARE LOGGED IN AS A BODY + SOUL MEMBER</p>[/show_if]');
    		echo do_shortcode('[show_if has_all="Body + Soul Membership,Bliss Habit E-Course Lifetime"]<p style="color:red;font-weight:700;text-align:center;">IF YOU SEE THIS YOU ARE LOGGED IN AS A MEMBER WITH FULL ACCESS</p>[/show_if]');
    		echo do_shortcode('[show_if not_any="Body + Soul Membership,Bliss Habit E-Course Lifetime"]<p style="color:red;font-weight:700;text-align:center;">IF YOU SEE THIS YOU ARE LOGGED IN BUT HAVE NO ACCESS</p>[/show_if]');
    	?>
    							
    		<div class="intro-text"><?php the_field('course_header_text'); ?></div>
    		<div class="row">
    						  
    			<?php 
    if (have_rows('courses')) :
    
              while (have_rows('courses')) : the_row();
    
                          $image = get_sub_field('course_image');
                          $course_url = get_sub_field('course_url');
                          $course_tags = get_sub_field('course_tags');
                          $course_title = get_sub_field('course_title');
    
                          if ($course_tags && is_user_logged_in()) {
    
                          $noaccess_html = '<a href="' . $course_url . '" class="module-item one-half">
                                        <div class="bg-image" style="background-image:linear-gradient(rgba(0,0,0,.30), rgba(0,0,0,.30)),url(\'' . $image["url"] . '\');min-height:362px;">
                                        <div class="content">
    							<i class="fa fa-lock" aria-hidden="true"></i>
                                          <h3>' . $course_title . '</h3>
                                        </div>
    									</div>
                                        </a>';
    						  
                          // shortcode if user doesn't have access
                          echo do_shortcode("[show_if not_any='".$course_tags."']" . $noaccess_html . "[/show_if]");
    
                          $access_html = '<a href="' . $course_url . '" class="module-item one-half">
                                        <div class="bg-image" style="background-image:linear-gradient(rgba(0,0,0,.30), rgba(0,0,0,.30)),url(\'' . $image["url"] . '\');min-height:362px;">
                                        <div class="content">
                                          <h3>' . $course_title . '</h3>
                                          <p>Continue Course</p>
                                        </div>
    									</div>
                                        </a>';
    						  
                          // shortcode if user has access
                          echo do_shortcode("[show_if has_one='".$course_tags."']" . $access_html . "[/show_if]");
    
                        } else {
    
                          // For visitors not logged in.
                          $notlogin_html = '<a href="' . $course_url . '" class="module-item one-half">
                                        <div class="bg-image" style="background-image:linear-gradient(rgba(0,0,0,.30), rgba(0,0,0,.30)),url(\'' . $image["url"] . '\');min-height:362px;">
                                        <div class="content">
    							<i class="fa fa-lock" aria-hidden="true"></i>
                                          <h3>' . $course_title . '</h3>
                                        </div>
    									</div>
                                        </a>';
                                        
                          echo $notlogin_html;
                        }
            endwhile;
    
          endif;
    ?>
    	
    		</div>
    	</div>
    </section>

    Am I doing something wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Have you checked with Support? They can troubleshoot the use of the shortcodes.

    We most often see issues with persistent cookies or cache in testing; even Chrome’s incognito mode will still read the WordPress admin cookie, so you might try using a clean instance of Chrome, in regular (not incognito) mode with all cookies and cache cleared.

    This article has some more on the plugins that might conflict with PilotPress: https://support.ontraport.com/hc/en-us/community/posts/213089227-What-WordPress-plugins-conflict-with-PilotPress-

    Thread Starter PDidee

    (@pdidee)

    Problem is I have colleagues logging in who’ve never visited the site and get the same results. Don’t have any of the listed plugins that might cause a conflict either.

    Please submit a support ticket so our team can check it out! You can chat Support from within your ONTRAPORT account by clicking the question mark (“help”) icon at the lower left of your screen and clicking on Support. If you are outside of our normal support hours (6 AM to 12 AM Pacific time most days) you can click to submit a support ticket.

    Support will have you create an Admin seat for them, and then trouble shoot the issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“not_any” Not working’ is closed to new replies.