Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // latest edition
- $taxonomies = array(
- 'jjm_editions',
- );
- $args = array(
- 'meta_key' => 'feature_this_edition_on_homepage', //the checkbox
- 'meta_value' => 'true',
- 'orderby' => 'ID',
- 'order' => 'DESC',
- 'hide_empty' => false,
- 'number' => '1'
- );
- $terms = get_terms($taxonomies, $args);
- foreach ( $terms as $term ) {
- $term_link = get_term_link( $term );
- if ( is_wp_error( $term_link ) ) {
- continue;
- }
- echo '<a href="' . esc_url( $term_link ) . '" class="button">Latest Edition</a>';
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement