Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tags in class=""

Discussion in 'Troubleshooting & How-To's' started by StevendeJong, May 5, 2014.

  1. StevendeJong

    New Member

    Joined:
    May 5, 2014
    Messages:
    2
    Likes Received:
    0
    I have added tags to my Custom Post Type. Now I want to use them to create a isotope portfolio, I can load all tags with this code:

    Code:
    <?php $args = array( 'post_type' => 'portfolio', 'posts_per_page' => 24;
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post(); ?>
        <div class="all <?php echo $tag->slug; ?>">
            <?php echo the_post_thumbnail(); ?>
            <p><?php the_title(); ?></p>
        </div>
    <?php endwhile; ?>
    But now I want to add the all tags that from each portfolio item to the class="". With <div class="<?php $tag->slug; ?>"> I just get the last tag of all the tags that are used.

    I know there are already a lot of posts about this problem, but every post I have found does not seem to work for me.
     
    #1

Share This Page

Web Hosting