Skip to content

Instantly share code, notes, and snippets.

@tomfinitely
Created June 24, 2014 18:16
Show Gist options
  • Save tomfinitely/70a8b66c621d730156a3 to your computer and use it in GitHub Desktop.
Save tomfinitely/70a8b66c621d730156a3 to your computer and use it in GitHub Desktop.
<?php
/**
* Faculty Archive
*
*/
# Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'su_faculty_taxonomy_archive_loop' );
function su_faculty_taxonomy_archive_loop() {
$post_id = null;
$taxonomies = get_object_taxonomies( array( 'post_type' => $post_type ) );
$taxonomy = 'department'; //change me
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$term_obj = get_term_by( 'slug' , $term , $taxonomy );
$position = get_field( '_faculty_position' );
$categories = get_categories($args);
if ($term->parent == 0) {
wp_list_categories('taxonomy=department&depth=1&show_count=0&hide_empty=0&title_li=&child_of=' . $term->term_id);
} else {
$args = array(
'post_type' => $post_type,
'posts_per_page' => 50, //show all posts
'tax_query' => array(
array(
'taxonomy' => $taxonomy,
'field' => 'slug',
'terms' => array( $term_obj->slug ),
)
)
);
$term = new WP_Query($args);
get_term( $term->slug, taxonomy, '', '' ) ;
query_posts(
array(
'post_type' => 'faculty',
'department' => $term->slug )
);
if ( have_posts() ) : while ( have_posts() ) : the_post();
echo '<h3>' . the_title() . '</h3>';
echo the_content();
endwhile;
endif;
wp_reset_query();
}
}
//* Remove items from loop
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
//* Move Title below Image
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_entry_footer', 'genesis_entry_header_markup_open', 5 );
add_action( 'genesis_entry_footer', 'genesis_entry_header_markup_close', 15 );
add_action( 'genesis_entry_footer', 'genesis_do_post_title' );
//* Remove Archive Pagination
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
genesis();
/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment