rep__get_the_agency_profile()
This code constructs HTML for displaying agency profiles, encompassing images and details, utilizing provided parameters.
Namespace
REP_Malcolm
Return
string
Agency profile
Source
File: \includes\rep-helper-functions.php
function rep__get_the_agency_profile( $post_id, $class="" ){
$image = lp__get_primary_image( lp__get_featured_image( $post_id ), "\REP_Malcolm\\rep__get_placeholder_image", "agency" );
$link = get_the_permalink( $post_id );
$hidden = lp__get_field_value( 'hide_post', $post_id );
$is_single_enabled = lp__get_field_value( REP__PREFIX.'_agency_single_page', 'option' );
$is_single_enabled = $is_single_enabled === false ? true : $is_single_enabled;
ob_start(); ?>
<div class="rep-agency-profile <?=$class?>">
<div class="lp-media rep-agency-media">
<div class="lp-overlay"></div><?php
if( ! $hidden && $link && $is_single_enabled ):
?><a class="rep-agency-link" href="<?= $link; ?>">
<div class="lp-image rep-agency-image" style="background-image: url(<?=$image;?>);"></div>
</a><?php
else:
?><div class="lp-image rep-agency-image" style="background-image: url(<?=$image;?>);"></div><?php
endif; ?>
</div>
<div class="rep-agency-content"><?php
echo rep__agency_details_html( $post_id, ['name', 'rating'] ); ?>
</div>
</div>
<?php $html = ob_get_clean();
return $html;
}