Advertisement
Guest User

Untitled

a guest
Nov 27th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?
  2.     query_posts(array(
  3.     'posts_per_page' => '10',
  4.     'orderby' => 'rand',
  5.     'post_type' => 'katalogas',
  6.    
  7. ));
  8.     if (have_posts()) : while (have_posts()) : the_post();
  9.      
  10.     ?>
  11.     <?php
  12. $tags = wp_get_post_tags($post->ID);
  13. $count=0; $sep='';
  14.   if ($tags) {
  15.     foreach($tags as $tag) {
  16.     $count++;
  17.       echo '<a href="' . get_term_link( $tag, 'post_tag' ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '><span>'. $tag->name.'</span></a>';
  18.       if( $count > 0 ) break; //change the number to adjust the count
  19.     }
  20.   }
  21. ?>
  22.    
  23.     <? endwhile; ?>
  24.  
  25. <? endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement