Show conditionnal taxonomy content outside the loop
-
Hey there,
I have to:
Display the content ofspecial taxonomyzed page
on the header, so outside of the loop.
And… I can’t get it.Custom taxonomy is created with WCK (WordPress Creation Kit) plugin.
Basicaly, on header.php:
> Start the loop
> Check if the page is special tax embeded
> If, then display the_content() of the page here (the template page doesn’t embedthe_content
)
> Stop the loop!Something like
<?php global $post; $post_id = $post->ID; if ( is_tax('splash-arg','big-header' ) ) { the_content(); } else { } ?>
OR, from codex
<!-- Start the Loop. --> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ( is_tax('splash-arg','big-header' ) ): ?> <?php the_content(); ?> <?php else: ?> <?php endif; ?>
OR
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php if (is_tax( 'big-header' )) :?> <?php the_content(); ?> <?php endwhile; ?>
OR again
<?php if ( has_term('splash-arg','big-header', $post->ID )) { ?> <?php the_content(); ?> <?php } ?>
This is certainly a not so hard trick, but I’m not enought techy, so I’m sorry…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Show conditionnal taxonomy content outside the loop’ is closed to new replies.