Advertisement
janter13

terms acak

Jan 2nd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <div class="allinfo"><h2>Genre: </h2>
  2. <?php
  3.  
  4. $taxonomy = 'genre';
  5. $tax_terms = get_terms($taxonomy,'number=14');
  6. shuffle($tax_terms);
  7. $tax_terms = array_slice($tax_terms , 0, 14);
  8. ?>
  9. <ul>
  10. <?php
  11. foreach ($tax_terms as $tax_term) {
  12. echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
  13. }
  14. ?>
  15. </ul>
  16. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement