I try to set up conditional tabs on a non cached post-page with custom post type.
I get the post-meta with ($post->external) what work fine if i echo the value.
Everything work as it should when i'm logged in.
In frontend modus and not logged in Tab3 is never show and tab2 do not disappear.
My Code:
<ul class="tabs" >
<li><a class="tabs" href="#tab1">Tab 1</a></li>
<?php echo (($post->external) == true ? '' : '<li><a class="tabs" href="#tab2">Tab 2</a></li>'); ?>
<?php echo (($post->external) == true ? '<li><a class="tabs" href="#tab3">Tab 3</a></li>' : ''); ?>
</ul>
Any Ideas?
Bob answers:
can you provide url or access?
Bob comments:
what will be return value of $post->external ?
true or false Boolean value?
Peter Brain comments:
Yes, Boolean
Bob comments:
It is possible that you might be loading some tabs related jquery like jquery ui when you are logged in.
do you have any javascript error in your console?
Luis Abarca answers:
Ummm, looks like both tabs are using the same value, maybe both can be mixed into one if.
Can you paste the full template ?
Sébastien | French WordpressDesigner answers:
use this code
<ul class="tabs" >
<li><a class="tabs" href="#tab1">Tab 1</a></li>
<?php echo (($post->external) == true ? '<li><a class="tabs" href="#tab3">Tab 3</a></li>' : '<li><a class="tabs" href="#tab2">Tab 2</a></li>'); ?>
</ul>
Peter Brain comments:
This work but only when i'm logged in.
Sébastien | French WordpressDesigner comments:
can you provide url ?
Peter Brain comments:
Sorry this is not possible