WordPress.org

Support

Support » How-To and Troubleshooting » Get tags form WP_Query();

Get tags form WP_Query();

  • Hi, I’m trying to modify posts based on the tags, but I can’t figure out how to get the tags. This is what i have so far:

    <?php
    	$main = new WP_Query();
    	$main->query('posts_per_page=8');
    	while($main->have_posts()) : $main->the_post();
    	$count++;
    ?>
    <!-- Do stuff -->
    <?php endwhile; ?>

    I want to be able to make an if statment like this:
    <?php if($tag == new){ echo"<img alt=\"\" src=\"http://example/wp-content/themes/mytheme/images/new.png\" class=\"newest\">";} ?>

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Get tags form WP_Query();’ is closed to new replies.
Skip to toolbar