“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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘“not_any” Not working’ is closed to new replies.