Created
May 27, 2014 03:21
-
-
Save AmeliaBriscoe/60fa1f543f5337e28690 to your computer and use it in GitHub Desktop.
Code displays taxonomy terms for a CPT in a Genesis archive template eg. archive-custom-post-type.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'genesis_after_content_sidebar_wrap', 'genesis_cpt_content' ); | |
| function genesis_cpt_content(){ | |
| if ( is_user_logged_in() ) { | |
| /* Display the different taxonomy topics */ | |
| $taxonomy = 'genesis_content'; | |
| $terms = get_terms( $taxonomy, '' ); | |
| echo '<div class="course-dashboard">'; | |
| echo '<div class="row clearfix">'; | |
| echo '<div class="first one-half box course-list">'; | |
| echo '<h4 class="widgettitle">Genesis Tutorials, Courses and Guides</h4>'; | |
| echo '<ul>'; | |
| foreach($terms as $term) { | |
| echo '<li class="cat-'.$term->term_id.'">'; | |
| echo '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.' ('.$term->count.')</a>'; | |
| echo '</li> '; | |
| } | |
| echo '</ul>'; | |
| echo '</div>'; | |
| genesis_widget_area( 'genesis-notices', array( | |
| 'before' => '<div class="one-half box">', | |
| 'after' => '</div>', | |
| ) ); | |
| echo '</div>'; | |
| echo '</div>'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment