/wp-content/themes/realhomes/author.php

https://bitbucket.org/joelkriteman/argento · PHP · 197 lines · 164 code · 26 blank · 7 comment · 16 complexity · 6bbf52b9aebc45958a72bc3c95c9faaf MD5 · raw file

  1. <?php
  2. get_header();
  3. ?>
  4. <div class="page-head" style="background-repeat: no-repeat;background-position: center top;background-image: url('<?php echo get_default_banner(); ?>'); ">
  5. <div class="container">
  6. <div class="wrap clearfix">
  7. <h1 class="page-title"><span><?php _e( 'All Properties By', 'framework' ); ?></span></h1>
  8. </div>
  9. </div>
  10. </div><!-- End Page Head -->
  11. <!-- Content -->
  12. <div class="container contents listing-grid-layout">
  13. <div class="row">
  14. <div class="span9 main-wrap">
  15. <!-- Main Content -->
  16. <div class="main">
  17. <section class="listing-layout">
  18. <?php
  19. // Get Author Information
  20. global $wp_query;
  21. $current_author = $wp_query->get_queried_object();
  22. $current_author_meta = get_user_meta( $current_author->ID );
  23. // Display Author Name
  24. if( !empty( $current_author->display_name ) ) { ?>
  25. <h3 class="title-heading"><?php echo $current_author->display_name; ?></h3>
  26. <?php } ?>
  27. <div class="list-container">
  28. <article class="about-agent agent-single clearfix">
  29. <div class="detail">
  30. <div class="row-fluid">
  31. <div class="span3">
  32. <?php
  33. // Author profile image
  34. if( isset( $current_author_meta['profile_image_id'] ) ) {
  35. $profile_image_id = intval( $current_author_meta['profile_image_id'][0] );
  36. if ( $profile_image_id ) {
  37. echo '<figure class="agent-pic">';
  38. echo wp_get_attachment_image( $profile_image_id, 'agent-image' );
  39. echo '</figure>';
  40. }
  41. } else if(function_exists('get_avatar')) {
  42. echo '<figure class="agent-pic">';
  43. echo get_avatar( $current_author->user_email, '210' );
  44. echo '</figure>';
  45. }
  46. ?>
  47. </div>
  48. <div class="span9">
  49. <div class="agent-content">
  50. <?php
  51. // Author description
  52. if( isset( $current_author_meta['description'] ) ) {
  53. echo '<p>';
  54. echo $current_author_meta['description'][0];
  55. echo '</p>';
  56. }
  57. ?>
  58. </div>
  59. <?php
  60. // Author Contact Info
  61. if( isset( $current_author_meta['mobile_number'] ) || isset( $current_author_meta['office_number'] ) || isset( $current_author_meta['fax_number'] ) ){
  62. ?>
  63. <hr/>
  64. <h5><?php _e('Contact Details', 'framework'); ?></h5>
  65. <ul class="contacts-list">
  66. <?php
  67. if(!empty( $current_author_meta['office_number'][0] )){
  68. ?><li class="office"><?php include( get_template_directory() . '/images/icon-phone.svg' ); _e('Office', 'framework'); ?> : <?php echo $current_author_meta['office_number'][0]; ?></li><?php
  69. }
  70. if( !empty( $current_author_meta['mobile_number'][0] ) ){
  71. ?><li class="mobile"><?php include( get_template_directory() . '/images/icon-mobile.svg' ); _e('Mobile', 'framework'); ?> : <?php echo $current_author_meta['mobile_number'][0]; ?></li><?php
  72. }
  73. if( !empty( $current_author_meta['fax_number'][0] ) ){
  74. ?><li class="fax"><?php include( get_template_directory() . '/images/icon-printer.svg' ); _e('Fax', 'framework'); ?> : <?php echo $current_author_meta['fax_number'][0]; ?></li><?php
  75. }
  76. ?>
  77. </ul>
  78. <?php
  79. }
  80. // Agent contact form
  81. get_template_part( 'template-parts/agent-contact-form' );
  82. ?>
  83. </div>
  84. </div><!-- end of .row-fluid -->
  85. </div>
  86. <div class="follow-agent clearfix">
  87. <?php
  88. // Author social links
  89. if( isset( $current_author_meta['facebook_url'] ) || isset( $current_author_meta['twitter_url'] ) || isset( $current_author_meta['google_plus_url'] ) || isset( $current_author_meta['linkedin_url'] ) ){
  90. ?>
  91. <!-- Agent's Social Navigation -->
  92. <ul class="social_networks clearfix">
  93. <?php
  94. if( !empty( $current_author_meta['facebook_url'][0] ) ) {
  95. ?>
  96. <li class="facebook">
  97. <a target="_blank" href="<?php echo $current_author_meta['facebook_url'][0]; ?>"><i class="fa fa-facebook fa-lg"></i></a>
  98. </li>
  99. <?php
  100. }
  101. if( !empty( $current_author_meta['twitter_url'][0] ) ) {
  102. ?>
  103. <li class="twitter">
  104. <a target="_blank" href="<?php echo $current_author_meta['twitter_url'][0]; ?>" ><i class="fa fa-twitter fa-lg"></i></a>
  105. </li>
  106. <?php
  107. }
  108. if( !empty( $current_author_meta['linkedin_url'][0] ) ) {
  109. ?>
  110. <li class="linkedin">
  111. <a target="_blank" href="<?php echo $current_author_meta['linkedin_url'][0]; ?>"><i class="fa fa-linkedin fa-lg"></i></a>
  112. </li>
  113. <?php
  114. }
  115. if( !empty( $current_author_meta['google_plus_url'][0] ) ) {
  116. ?>
  117. <li class="gplus">
  118. <a target="_blank" href="<?php echo $current_author_meta['google_plus_url'][0]; ?>"><i class="fa fa-google-plus fa-lg"></i></a>
  119. </li>
  120. <?php
  121. }
  122. ?>
  123. </ul>
  124. <?php
  125. }
  126. ?>
  127. </div>
  128. </article>
  129. <?php
  130. // query based on author properties
  131. $author_properties_args = array(
  132. 'post_type' => 'property',
  133. 'posts_per_page' => -1,
  134. 'author' => $current_author->ID
  135. );
  136. $author_properties_query = new WP_Query( $author_properties_args );
  137. if ( $author_properties_query->have_posts() ) :
  138. while ( $author_properties_query->have_posts() ) :
  139. $author_properties_query->the_post();
  140. /* Display Property for Listing */
  141. get_template_part('template-parts/property-for-listing');
  142. endwhile;
  143. else:
  144. alert( '', __( 'No Properties Found!', 'framework' ) );
  145. endif;
  146. wp_reset_query();
  147. ?>
  148. </div>
  149. </section>
  150. </div><!-- End Main Content -->
  151. </div> <!-- End span9 -->
  152. <?php get_sidebar('agent'); ?>
  153. </div><!-- End contents row -->
  154. </div><!-- End Content -->
  155. <?php get_footer(); ?>