Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Person Content Template, and person archives.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmbacon committed Nov 11, 2015
1 parent d006cb2 commit d91ac7d
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 5 deletions.
20 changes: 15 additions & 5 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@

elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
_e( 'Chats', 'cs' );

elseif ( is_tax( 'group') || is_tax('persontag')):
global $wp_query;
$term = $wp_query->get_queried_object();
$name = $term->name;
echo $name;

else :
_e( 'Archives', 'cs' );
Expand All @@ -81,11 +87,15 @@
<?php while ( have_posts() ) : the_post(); ?>

<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
if ( is_tax( 'group') || is_tax('persontag')){
get_template_part( 'content', 'person' );
} else {
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
}
?>

<?php endwhile; ?>
Expand Down
62 changes: 62 additions & 0 deletions content-person.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

$information_to_display = get_field( "information_to_display" );


?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<?php if ( has_post_thumbnail() ) {
echo '<div class="row">';
echo '<div class="col-sm-2"><a href="'.get_permalink().'">';
the_post_thumbnail();
echo '</a></div>';
echo '<div class="col-sm-10">';
} ?>
<header class="entry-header">
<?php
echo '<h2><a href="'.get_permalink().'">';
the_field('first_name');
echo ' ';
if (get_field('middle_name')){
the_field('middle_name');
echo ' ';
}
the_field('last_name');
echo '</a></h2>';
?>
</header><!-- .entry-header -->




<div class="entry-content clearfix subpage">
<?php

echo '<p>'.get_field('title').'</p>';
if (strlen(get_field('email')) . 0 ){
echo '<p><a href="mailto:'.get_field('email').'">'.get_field('email').'</a></p>';
}
if (strlen(get_field('phone')) > 0 ){
echo '<p>'.get_field('phone').'</p>';
}

?>




<hr/>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'cs' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->

<?php if ( has_post_thumbnail() ) {
echo '</div>';
echo '</div>';
} ?>
</article><!-- #post-## -->

0 comments on commit d91ac7d

Please sign in to comment.