If you are trying to add PHP code to a memberium website for a situation where you only want to show content if they don’t have a specific Infusionsoft/Keap tag. You will want to use the “memb_hasAnyTags” shortcode with the added ! in front of it. It would make it look like this !memb_hasAnyTags

I’ll create a simple example below of a PHP IF statement to show a hyperlinked image if the don’t have the tag ID 9388.

<?php if ( !memb_hasAnyTags( 9388, $contact_id = false ) ) { ?>
<a href=”https://www.example.com/” class=”cell”>
<div class=”clear box”>
<img src=”<?php echo esc_url( get_template_directory_uri() ); ?>/new-assests/images/ow.png”/>
<div class=”title”>
ASK A <br/>
<b>COACH </b>

<p>Click to learn more</p>

<?php }?>

Of course you can add an else statement as well and do whatever you like this it. Hope if helps. If you find an easier way please comment below. It worked for me and it might work for you too.

If you would like to show this content to logged in contacts that DO have the tag. Just remove the “!”. Please click here to read further.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>