Skip to content

Instantly share code, notes, and snippets.

@contempoinc
Created September 1, 2015 01:25
Show Gist options
  • Save contempoinc/a5abcf60265f379caae0 to your computer and use it in GitHub Desktop.
Save contempoinc/a5abcf60265f379caae0 to your computer and use it in GitHub Desktop.
<?php
/**
* Template Name: Agents
*
* @package WP Pro Real Estate 5
* @subpackage Template
*/
global $ct_options;
get_header();
echo '<header id="archive-header" class="marB40">';
echo '<div class="container">';
echo '<h1 class="marB0 left">';
echo the_title();
echo '</h1>';
echo ct_breadcrumbs();
echo '<div class="clear"></div>';
echo '</div>';
echo '</header>';
echo '<div class="container">';
if($ct_options['ct_layout'] == 'left-sidebar') {
echo '<div id="sidebar" class="col span_3">';
if (function_exists('dynamic_sidebar') && dynamic_sidebar('Left Sidebar Agents') ) :else: endif;
echo '</div>';
}
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="col span_9 <?php if($ct_options['ct_layout'] == 'right-sidebar') { echo 'first'; } ?>">
<?php the_content(); ?>
<ul>
<?php
global $wpdb;
$query = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename";
$author_ids = $wpdb->get_results($query);
$author_page_url = $curauth->user_url;
foreach($author_ids as $author) : $curauth = get_userdata($author->ID);
if($curauth->user_level >= 0 && $curauth->user_level != 10 && $curauth->user_level != 5) : $user_link = get_author_posts_url($curauth->ID); ?>
<li class="member">
<?php if($curauth->ct_profile_url) { ?>
<figure class="col span_3">
<img class="author-img left" src="<?php echo aq_resize($curauth->ct_profile_url,120); ?>" />
</figure>
<?php } ?>
<div class="author-info col span_9">
<h2 class="marB0"><a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>"><?php echo $curauth->display_name; ?></a></h2>
<?php if ($curauth->title) { ?><h3><?php echo $curauth->title; ?></h3><?php } ?>
<?php if($curauth->tagline) { ?><p id="tagline"><strong><?php echo $curauth->tagline; ?></strong></p><?php } ?>
<?php if($curauth->mobile) { ?><p class="marT10 marB3"><?php _e('Mobile', 'contempo'); ?>: <?php echo $curauth->mobile; ?></p><?php } ?>
<?php if($curauth->office) { ?><p class="marB3"><?php _e('Office', 'contempo'); ?>: <?php echo $curauth->office; ?></p><?php } ?>
<?php if($curauth->fax) { ?><p class="marB6"><?php _e('Fax', 'contempo'); ?>: <?php echo $curauth->fax; ?></p><?php } ?>
<?php if($curauth->brokername) { ?><p class="marB3"><strong><?php echo $curauth->brokername; ?></strong></p><?php } ?>
<?php if($curauth->brokernum) { ?><p class="marB3"><?php echo $curauth->brokernum; ?></p><?php } ?>
<p><?php the_author_meta( 'description', $author->ID ); ?></p>
<p><strong><a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>"><?php _e('View all listings', 'contempo'); ?></a></strong></p>
<ul class="marL0">
<?php if ($author_twitter) { ?><li class="twitter"><a href="http://twitter.com/#!/<?php echo $author_twitter; ?>" target="_blank">Twitter</a></li><?php } ?>
<?php if ($author_facebook) { ?><li class="facebook"><a href="<?php echo $author_facebook; ?>" target="_blank"><?php _e( 'Facebook', 'contempo' ); ?></a></li><?php } ?>
<?php if ($author_linkedin) { ?><li class="facebook"><a href="<?php echo $author_linkedin; ?>" target="_blank"><?php _e( 'LinkedIn', 'contempo' ); ?></a></li><?php } ?>
<?php if ($author_google) { ?><li class="google"><a href="<?php echo $author_google; ?>" target="_blank"><?php _e( 'Google+', 'contempo' ); ?></a></li><?php } ?>
</ul>
</div>
</li>
<div class="clear"></div>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php //wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'contempo' ) . '</span>', 'after' => '</div>' ) ); ?>
<?php endwhile; endif; wp_reset_query(); ?>
<div class="clear"></div>
</article>
<?php if($ct_options['ct_layout'] == 'right-sidebar') {
echo '<div id="sidebar" class="col span_3">';
if (function_exists('dynamic_sidebar') && dynamic_sidebar('Right Sidebar Agents') ) :else: endif;
echo '</div>';
}
echo '</div>';
get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment