WordPress.org

Ready to get started?Download WordPress

Forums

Get tags form WP_Query(); (2 posts)

  1. patriktg
    Member
    Posted 3 years ago #

    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

  2. Taylor Dewey
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic