Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php // latest edition
  2. $taxonomies = array(
  3. 'jjm_editions',
  4. );
  5. $args = array(
  6. 'meta_key' => 'feature_this_edition_on_homepage', //the checkbox
  7. 'meta_value' => 'true',
  8. 'orderby' => 'ID',
  9. 'order' => 'DESC',
  10. 'hide_empty' => false,
  11. 'number' => '1'
  12. );
  13. $terms = get_terms($taxonomies, $args);
  14. foreach ( $terms as $term ) {
  15. $term_link = get_term_link( $term );
  16. if ( is_wp_error( $term_link ) ) {
  17. continue;
  18. }
  19. echo '<a href="' . esc_url( $term_link ) . '" class="button">Latest Edition</a>';
  20. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement