How to define some condition to get_tag_link() i.e.
i would like to show link about a Tag ID concerning only posts not page.
At the moment using following code:
i have a list of both posts and pages with tag ID=6.
Thanks
ops...here the code
<ul> <li style="list-style-type:circle!important;">
<a href="<?php echo get_tag_link(6); ?>">Lista di Articoli con contenuti relativi al Genoa</a>
</li>
</ul>
<?php
$args=array(
'tag__in' => array(6),
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'List of Posts for tag id 6';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
Hi Michael,
i justuo upload your code.
Thank yoy very much.
Best Regards
g.