Origin commit
This commit is contained in:
123
templates/single-property/user/author-member-box.php
Executable file
123
templates/single-property/user/author-member-box.php
Executable file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
if( !isset($id) ){
|
||||
$id = get_the_ID();
|
||||
}
|
||||
|
||||
if( !isset($prefix) ){
|
||||
$prefix = OPALESTATE_AGENCY_PREFIX;
|
||||
}
|
||||
|
||||
$avatar = get_post_meta( $id , $prefix . "avatar", true );
|
||||
$post = get_post( $id );
|
||||
$link = get_permalink( $id );
|
||||
$name = get_the_title( $id );
|
||||
$trusted = get_post_meta( $id, $prefix.'trusted', true );
|
||||
?>
|
||||
<div class="property-agent-contact ">
|
||||
<?php $is_sticky = get_post_meta( $id, $prefix . 'sticky', true ); ?>
|
||||
<div class="agent-box agency-box">
|
||||
<div class="team-header">
|
||||
<?php if( $type =='agency'): ?>
|
||||
<div class="agent-preview has-avatar"><a href="<?php echo esc_url($link); ?>">
|
||||
<?php if ( has_post_thumbnail( $id ) ) : ?>
|
||||
<?php echo get_the_post_thumbnail( $id, 'full' ); ?>
|
||||
<?php endif; ?>
|
||||
<img src="<?php echo esc_url($avatar);?> " class="agent-avatar"></a>
|
||||
|
||||
<?php if( $trusted ): ?>
|
||||
<span class="trusted-label hint--top" aria-label="<?php esc_html_e('Trusted Member', 'opalestate-pro'); ?>" title="<?php esc_html_e('Trusted Member', 'opalestate-pro'); ?>">
|
||||
<i class="fa fa-star"></i>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="agent-preview"><a href="<?php echo esc_url($link); ?>">
|
||||
<img src="<?php echo esc_url($avatar);?> " class="agent-avatar"></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="agent-box-meta">
|
||||
<h4 class="agent-box-title">
|
||||
<a href="<?php echo esc_url( $link ); ?>">
|
||||
<?php echo esc_html( $post->post_title ); ?>
|
||||
</a>
|
||||
</h4><!-- /.agent-box-title -->
|
||||
|
||||
|
||||
<?php $email = get_post_meta( $id, $prefix . 'email', true ); ?>
|
||||
<?php if ( ! empty( $email ) ) : ?>
|
||||
<div class="agent-box-email">
|
||||
<i class="fa fa-envelope"></i>
|
||||
<a href="mailto:<?php echo esc_attr( $email ); ?>">
|
||||
<span><?php echo esc_attr( $email ); ?></span>
|
||||
</a>
|
||||
</div><!-- /.agent-box-email -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php $phone = get_post_meta( $id, $prefix . 'phone', true ); ?>
|
||||
<?php if ( ! empty( $phone ) ) : ?>
|
||||
<div class="agent-box-phone">
|
||||
<i class="fa fa-phone"></i><span><a href="tel:<?php echo sanitize_title( $phone ); ?>"><?php echo esc_attr( $phone ); ?></a></span>
|
||||
</div><!-- /.agent-box-phone -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $mobile = get_post_meta( $id, $prefix . 'mobile', true ); ?>
|
||||
<?php if ( ! empty( $mobile ) ) : ?>
|
||||
<div class="agent-box-mobile">
|
||||
<i class="fa fa-mobile"></i><span><a href="tel:<?php echo sanitize_title( $phone ); ?>"><?php echo esc_attr( $mobile ); ?></a></span>
|
||||
</div><!-- /.agent-box-phone -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $fax = get_post_meta( $id, $prefix . 'fax', true ); ?>
|
||||
<?php if ( ! empty( $fax ) ) : ?>
|
||||
<div class="agent-box-fax">
|
||||
<i class="fa fa-fax"></i><span><?php echo esc_attr( $fax ); ?></span>
|
||||
</div><!-- /.agent-box-phone -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $web = get_post_meta( $id, $prefix . 'web', true ); ?>
|
||||
<?php if ( ! empty( $web ) ) : ?>
|
||||
<div class="agent-box-web">
|
||||
<i class="fa fa-globe"></i>
|
||||
<a href="<?php echo esc_attr( $web ); ?>" rel="nofollow" target="_blank">
|
||||
<span><?php echo esc_attr( $web ); ?></span>
|
||||
</a>
|
||||
</div><!-- /.agent-box-web -->
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$facebook = get_post_meta( $id, $prefix . 'facebook', true );
|
||||
$twitter = get_post_meta( $id, $prefix . 'twitter', true );
|
||||
$pinterest = get_post_meta( $id, $prefix . 'pinterest', true );
|
||||
$google = get_post_meta( $id, $prefix . 'google', true );
|
||||
$instagram = get_post_meta( $id, $prefix . 'instagram', true );
|
||||
$linkedIn = get_post_meta( $id, $prefix . 'linkedIn', true );
|
||||
?>
|
||||
<div class="opalestate-social-icons">
|
||||
<?php if( $facebook && $facebook != "#" && !empty($facebook) ){ ?>
|
||||
<a class="opalestate-social-white radius-x" rel="nofollow" href="<?php echo esc_url( $facebook ); ?>"> <i class="fa fa-facebook"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if( $twitter && $twitter != "#" && !empty($twitter) ){ ?>
|
||||
<a class="opalestate-social-white radius-x" rel="nofollow" href="<?php echo esc_url( $twitter ); ?>"><i class="fa fa-twitter"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if( $pinterest && $pinterest != "#" && !empty($pinterest)){ ?>
|
||||
<a class="opalestate-social-white radius-x" rel="nofollow" href="<?php echo esc_url( $pinterest ); ?>"><i class="fa fa-pinterest"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if( $google && $google != "#" && !empty($google) ){ ?>
|
||||
<a class="opalestate-social-white radius-x" rel="nofollow" href="<?php echo esc_url( $google ); ?>"> <i class="fa fa-google"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( $instagram && $instagram != "#" && !empty($instagram) ){ ?>
|
||||
<a class="opalestate-social-white radius-x" rel="nofollow" href="<?php echo esc_url( $instagram ); ?>"> <i class="fa fa-instagram"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( $linkedIn && $linkedIn != "#" && !empty($linkedIn) ){ ?>
|
||||
<a class="opalestate-social-white radius-x" rel="nofollow" href="<?php echo esc_url( $linkedIn ); ?>"> <i class="fa fa-linkedIn"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- /.agent-box-content -->
|
||||
</div><!-- /.agent-box-->
|
||||
</div>
|
||||
110
templates/single-property/user/author-user-box-list.php
Executable file
110
templates/single-property/user/author-user-box-list.php
Executable file
@@ -0,0 +1,110 @@
|
||||
<?php if ( $author ): ?>
|
||||
<div class="property-agent-contact ">
|
||||
<?php
|
||||
|
||||
if ( ! isset( $prefix ) ) {
|
||||
$prefix = OPALESTATE_USER_PROFILE_PREFIX;
|
||||
}
|
||||
|
||||
$user_id = $author->ID;
|
||||
$is_sticky = get_user_meta( $user_id, $prefix . 'sticky', true );
|
||||
$picture = OpalEstate_User::get_author_picture( $user_id );
|
||||
|
||||
$desciption = get_user_meta( $user_id, 'description', true );
|
||||
|
||||
|
||||
$roles = opalestate_user_roles_by_user_id( $user_id );
|
||||
|
||||
if ( ! is_array( $roles ) ) {
|
||||
$roles = [ $roles ];
|
||||
}
|
||||
|
||||
$related = get_user_meta( $user_id, $prefix . 'related_id', true );
|
||||
$trusted = false;
|
||||
if ( in_array( 'opalestate_agency', $roles ) || in_array( 'opalestate_agent', $roles ) ) {
|
||||
$link = get_permalink( $related );
|
||||
$author_name = get_the_title( $related );
|
||||
$trusted = get_post_meta( $related, $prefix . 'trusted', true );
|
||||
} elseif ( $related ) {
|
||||
|
||||
$link = get_permalink( $related );
|
||||
$author_name = get_the_title( $related );
|
||||
$trusted = get_user_meta( $user_id, $prefix . 'trusted', true );
|
||||
|
||||
} else {
|
||||
$link = get_author_posts_url( $user_id );
|
||||
$author_name = $author->display_name;
|
||||
$trusted = get_user_meta( $user_id, $prefix . 'trusted', true );
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="agent-box-list">
|
||||
<div class="inner">
|
||||
<div class="agent-preview">
|
||||
<a href="<?php echo esc_url( $link ); ?>" class="agent-box-image-inner">
|
||||
<img src="<?php echo esc_url( $picture ); ?>" title="<?php echo esc_attr( $author_name ); ?>">
|
||||
</a>
|
||||
</div>
|
||||
<div class="agent-box-meta">
|
||||
<h4>
|
||||
<?php if ( $trusted ): ?>
|
||||
<span class="trusted-label hint--top" aria-label="<?php esc_html_e( 'Trusted Member', 'opalestate-pro' ); ?>"
|
||||
title="<?php esc_html_e( 'Trusted Member', 'opalestate-pro' ); ?>">
|
||||
<i class="fa fa-star"></i>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<a href="<?php echo esc_url( $link ); ?>"><?php echo esc_html( $author_name ); ?></a>
|
||||
</h4>
|
||||
|
||||
<?php
|
||||
$job = get_user_meta( $user_id, $prefix . 'address', true );
|
||||
?>
|
||||
<p class="agent-box-address"><?php echo esc_html( $job ); ?></p>
|
||||
<?php $phone = get_user_meta( $user_id, $prefix . 'phone', true ); ?>
|
||||
<?php if ( ! empty( $phone ) ) : ?>
|
||||
<div class="agent-box-phone">
|
||||
<i class="fa fa-phone"></i><span><a href="tel:<?php echo sanitize_title( $phone ); ?>"><?php echo esc_attr( $phone ); ?></a></span>
|
||||
</div><!-- /.agent-box-phone -->
|
||||
<?php endif; ?>
|
||||
</div><!-- /.agent-box-content -->
|
||||
|
||||
|
||||
<?php
|
||||
$facebook = get_user_meta( $user_id, $prefix . 'facebook', true );
|
||||
$twitter = get_user_meta( $user_id, $prefix . 'twitter', true );
|
||||
$pinterest = get_user_meta( $user_id, $prefix . 'pinterest', true );
|
||||
$google = get_user_meta( $user_id, $prefix . 'googleplus', true );
|
||||
$instagram = get_user_meta( $user_id, $prefix . 'instagram', true );
|
||||
$linkedIn = get_user_meta( $user_id, $prefix . 'linkedIn', true );
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="opalestate-social-icons text-center">
|
||||
<?php if ( $facebook && $facebook != "#" && ! empty( $facebook ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $facebook ); ?>"> <i class="fa fa-facebook"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if ( $twitter && $twitter != "#" && ! empty( $twitter ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $twitter ); ?>"><i class="fa fa-twitter"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if ( $pinterest && $pinterest != "#" && ! empty( $pinterest ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $pinterest ); ?>"><i class="fa fa-pinterest"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if ( $google && $google != "#" && ! empty( $google ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $google ); ?>"> <i class="fa fa-google-plus"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $instagram && $instagram != "#" && ! empty( $instagram ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $instagram ); ?>"> <i class="fa fa-instagram"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $linkedIn && $linkedIn != "#" && ! empty( $linkedIn ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $linkedIn ); ?>"> <i class="fa fa-linkedIn"></i></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- /.agent-box-->
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
153
templates/single-property/user/author-user-box.php
Executable file
153
templates/single-property/user/author-user-box.php
Executable file
@@ -0,0 +1,153 @@
|
||||
<?php if ( $author ): ?>
|
||||
<div class="property-agent-contact ">
|
||||
<?php
|
||||
|
||||
if ( ! isset( $prefix ) ) {
|
||||
$prefix = OPALESTATE_USER_PROFILE_PREFIX;
|
||||
}
|
||||
|
||||
$user_id = $author->ID;
|
||||
$is_sticky = get_user_meta( $user_id, $prefix . 'sticky', true );
|
||||
|
||||
|
||||
$desciption = get_user_meta( $user_id, 'description', true );
|
||||
|
||||
$roles = opalestate_user_roles_by_user_id( $user_id );
|
||||
|
||||
if ( ! is_array( $roles ) ) {
|
||||
$roles = [ $roles ];
|
||||
}
|
||||
|
||||
$related = get_user_meta( $user_id, $prefix . 'related_id', true );
|
||||
$trusted = false;
|
||||
if ( in_array( 'opalestate_agency', $roles ) || in_array( 'opalestate_agent', $roles ) ) {
|
||||
$post = get_post( $related );
|
||||
$link = get_permalink( $related );
|
||||
$author_name = $post->post_title;
|
||||
|
||||
if ( $post->post_type == 'opalestate_agency' ) {
|
||||
$prefixs = OPALESTATE_AGENCY_PREFIX;
|
||||
$picture = OpalEstate_Agency::get_avatar_url( $post->ID );
|
||||
} else {
|
||||
$prefixs = OPALESTATE_AGENT_PREFIX;
|
||||
$picture = OpalEstate_Agent::get_avatar_url( $post->ID );
|
||||
}
|
||||
|
||||
$trusted = get_post_meta( $related, $prefixs . 'trusted', true );
|
||||
} elseif ( $related ) {
|
||||
$post = get_post( $related );
|
||||
$link = get_permalink( $related );
|
||||
$author_name = $post->post_title;
|
||||
|
||||
if ( $post->post_type == 'opalestate_agency' ) {
|
||||
$prefixs = OPALESTATE_AGENCY_PREFIX;
|
||||
$picture = OpalEstate_Agency::get_avatar_url( $post->ID );
|
||||
} else {
|
||||
$prefixs = OPALESTATE_AGENT_PREFIX;
|
||||
$picture = OpalEstate_Agent::get_avatar_url( $post->ID );
|
||||
}
|
||||
|
||||
$trusted = get_post_meta( $related, $prefixs . 'trusted', true );
|
||||
} else {
|
||||
$link = get_author_posts_url( $user_id );
|
||||
$author_name = $author->display_name;
|
||||
$trusted = get_user_meta( $user_id, $prefix . 'trusted', true );
|
||||
$picture = OpalEstate_User::get_author_picture( $user_id );
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="agent-box">
|
||||
|
||||
<div class="agent-preview">
|
||||
<div class="team-header <?php if ( empty( $picture ) ) {
|
||||
echo 'without-image';
|
||||
} ?>">
|
||||
<?php if ( $trusted ): ?>
|
||||
<span class="trusted-label hint--top" aria-label="<?php esc_html_e( 'Trusted Member', 'opalestate-pro' ); ?>"
|
||||
title="<?php esc_html_e( 'Trusted Member', 'opalestate-pro' ); ?>">
|
||||
<i class="fa fa-star"></i>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<a href="<?php echo esc_url( $link ); ?>" class="agent-box-image-inner">
|
||||
<img src="<?php echo esc_url( $picture ); ?>" title="<?php echo esc_attr( $author_name ); ?>">
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- /.agent-preview -->
|
||||
|
||||
|
||||
<div class="agent-box-meta">
|
||||
<h4 class="agent-box-title">
|
||||
<a href="<?php echo esc_url( $link ); ?>"><?php echo esc_html( $author_name ); ?></a>
|
||||
</h4><!-- /.agent-box-title -->
|
||||
|
||||
<?php
|
||||
$job = get_user_meta( $user_id, $prefix . 'job', true );
|
||||
?>
|
||||
<p class="agent-box-job"><?php echo esc_html( $job ); ?></p>
|
||||
|
||||
<?php $email = get_user_meta( $user_id, $prefix . 'email', true ); ?>
|
||||
<?php if ( ! empty( $email ) ) : ?>
|
||||
<div class="agent-box-email">
|
||||
<i class="fa fa-envelope"></i>
|
||||
<a href="mailto:<?php echo esc_attr( $email ); ?>">
|
||||
<span><?php echo esc_attr( $email ); ?></span>
|
||||
</a>
|
||||
</div><!-- /.agent-box-email -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $phone = get_user_meta( $user_id, $prefix . 'phone', true ); ?>
|
||||
<?php if ( ! empty( $phone ) ) : ?>
|
||||
<div class="agent-box-phone">
|
||||
<i class="fa fa-phone"></i><span><a href="tel:<?php echo sanitize_title( $phone ); ?>"><?php echo esc_attr( $phone ); ?></a></span>
|
||||
</div><!-- /.agent-box-phone -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $web = get_user_meta( $user_id, $prefix . 'web', true ); ?>
|
||||
<?php if ( ! empty( $web ) ) : ?>
|
||||
<div class="agent-box-web">
|
||||
<i class="fa fa-globe"></i>
|
||||
<a href="<?php echo esc_attr( $web ); ?>">
|
||||
<span><?php echo esc_attr( $web ); ?></span>
|
||||
</a>
|
||||
</div><!-- /.agent-box-web -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$facebook = get_user_meta( $user_id, $prefix . 'facebook', true );
|
||||
$twitter = get_user_meta( $user_id, $prefix . 'twitter', true );
|
||||
$pinterest = get_user_meta( $user_id, $prefix . 'pinterest', true );
|
||||
$google = get_user_meta( $user_id, $prefix . 'googleplus', true );
|
||||
$instagram = get_user_meta( $user_id, $prefix . 'instagram', true );
|
||||
$linkedIn = get_user_meta( $user_id, $prefix . 'linkedIn', true );
|
||||
?>
|
||||
|
||||
<div class="opalestate-social-icons">
|
||||
<?php if ( $facebook && $facebook != "#" && ! empty( $facebook ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $facebook ); ?>"> <i class="fa fa-facebook"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if ( $twitter && $twitter != "#" && ! empty( $twitter ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $twitter ); ?>"><i class="fa fa-twitter"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if ( $pinterest && $pinterest != "#" && ! empty( $pinterest ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $pinterest ); ?>"><i class="fa fa-pinterest"></i> </a>
|
||||
<?php } ?>
|
||||
<?php if ( $google && $google != "#" && ! empty( $google ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $google ); ?>"> <i class="fa fa-google-plus"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $instagram && $instagram != "#" && ! empty( $instagram ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $instagram ); ?>"> <i class="fa fa-instagram"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $linkedIn && $linkedIn != "#" && ! empty( $linkedIn ) ) { ?>
|
||||
<a class="opalestate-social-white radius-x" href="<?php echo esc_url( $linkedIn ); ?>"> <i class="fa fa-linkedIn"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- /.agent-box-content -->
|
||||
|
||||
</div><!-- /.agent-box-->
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user