';
//simple for people list or shortcode
if ( $people_list || $shortcode ) {
$html .= apollo13framework_make_people_image( $post_id, '', $columns, $max_width, $margin );
} //fixed for other place
else {
//prepare image in proportion
$image_width = 800;/* 800 - not depending on current theme settings for people list */
$brick_proportion = 1/1;//$apollo13framework_a13->get_option( 'people_list_bricks_proportions_size' );
$height_proportion = apollo13framework_calculate_height_proportion( $brick_proportion );
$image_height = $image_width * $height_proportion;
$html .= apollo13framework_make_people_image( $post_id, array( $image_width, $image_height ) );
}
$cover_color = $apollo13framework_a13->get_meta( '_overlay_bg_color' );
if ( $cover_color === '' || $cover_color === false || $cover_color === 'transparent' ) {
//no color - default to CSS value
$html .= '
';
} else {
$html .= '
';
}
$text_color = $apollo13framework_a13->get_meta( '_overlay_font_color' );
if ( $text_color === '' || $text_color === false || $text_color === 'transparent' ) {
//no color - default to CSS value
$text_style = '';
} else {
$text_style = ' style="color:' . esc_attr( $text_color ). ';"';
}
$html .= '
';
$html .= '
';
if ( post_password_required( $post_id ) ) {
$html .= '
';
$html .= '
';
$html .= '' . esc_html__( 'This content is password protected', 'rife-free' );
$html .= '
';
$html .= '
';
$html .= '
' . esc_html__( 'Click and enter your password to view content', 'rife-free' ) . '
';
$html .= '
';
$html .= '
';
} else {
$html .= '
';
//return taxonomy for people
$html .= '
' . esc_html( $apollo13framework_a13->get_meta( '_subtitle' ) ) . '
';
//title
$html .= the_title( '
', '
', false );
$html .= '
';
$html .= get_the_content();
$html .= '
';
//social icons
$all_meta = get_post_meta( $post->ID );
$socials_list = $apollo13framework_a13->get_social_icons_list('empty');
foreach( $socials_list as $id=>$social){
$socials_list[$id] = isset($all_meta['_'.$id])? $all_meta['_'.$id][0] : '';
}
$html .= apollo13framework_social_icons( $apollo13framework_a13->get_option( 'people_socials_color' ), $apollo13framework_a13->get_option( 'people_socials_color_hover' ), $socials_list );
$html .= '
';
}
$html .= '
'; //.caption
$html .= '
';
}
return $html;
}
}
if(!function_exists('apollo13framework_people_list_individual_look')){
/**
* Prepares CSS specially for each people list
*/
function apollo13framework_people_list_individual_look($id, $max_width, $margin){
$css = '';
$max_width = (int) $max_width;
$max_width = esc_html( apollo13framework_make_css_rule( 'max-width', $max_width, '%spx' ) );
$margin = (int) $margin;
$margin = esc_html( $margin . 'px' );
$calc_safe_margin = esc_html( $margin === '0px' ? '' : ' - ' . $margin );
//space in case of different layout mode
$item_bottom_gutter = wp_strip_all_tags( 'margin-bottom: ' . $margin . ';' );
$selector_class = wp_strip_all_tags( '.people-bricks-' . $id );
$css .= '
'.$selector_class.'{
'.$max_width.'
}
'.$selector_class.' .people-grid-container{
margin-right: -'.$margin.';
}
.rtl '.$selector_class.' .people-grid-container{
margin-right: 0;
margin-left: -'.$margin.';
}
'.$selector_class.' .layout-fitRows .archive-item,
'.$selector_class.' .layout-masonry .archive-item{
'.$item_bottom_gutter.'
}
/* 4 columns */
'.$selector_class.'.people-columns-4 .archive-item,
'.$selector_class.'.people-columns-4 .grid-master{
width: calc(25%'.$calc_safe_margin.');
}
/* 3 columns */
'.$selector_class.'.people-columns-3 .archive-item,
'.$selector_class.'.people-columns-3 .grid-master{
width: calc(33.3333333%'.$calc_safe_margin.');
}
/* 2 columns */
'.$selector_class.'.people-columns-2 .archive-item,
'.$selector_class.'.people-columns-2 .grid-master{
width: calc(50%'.$calc_safe_margin.');
}
/* 100% width bricks */
'.$selector_class.'.people-columns-1 .grid-master,
'.$selector_class.'.people-columns-1 .archive-item{
width: calc(100%'.$calc_safe_margin.');
}
@media only screen and (max-width: 1279px){
/* 4 -> 3 columns */
'.$selector_class.'.people-columns-4 .archive-item,
'.$selector_class.'.people-columns-4 .grid-master{
width: calc(33.3333333%'.$calc_safe_margin.');
}
}
@media only screen and (max-width: 800px){
/* 4,3 -> 2 columns */
'.$selector_class.'.people-columns-4 .grid-master,
'.$selector_class.'.people-columns-4 .archive-item,
'.$selector_class.'.people-columns-3 .grid-master,
'.$selector_class.'.people-columns-3 .archive-item{
width: calc(50%'.$calc_safe_margin.');
}
}
@media only screen and (max-width: 480px) {
'.$selector_class.' .people-grid-container{
margin-right: 0;
}
.rtl '.$selector_class.' .people-grid-container{
margin-left: 0;
}
/* all bricks layouts -> 1 column */
'.$selector_class.'.people-columns-4 .grid-master,
'.$selector_class.'.people-columns-4 .archive-item,
'.$selector_class.'.people-columns-3 .grid-master,
'.$selector_class.'.people-columns-3 .archive-item,
'.$selector_class.'.people-columns-2 .grid-master,
'.$selector_class.'.people-columns-2 .archive-item,
'.$selector_class.'.people-columns-1 .grid-master,
'.$selector_class.'.people-columns-1 .archive-item{
width: 100%;
}
}';
//if we have some CSS then add it
if(strlen($css)){
$css = apollo13framework_minify_css($css);
// Elementor edit mode
if ( defined('ELEMENTOR_VERSION') && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
//we need to print inline CSS this way, cause otherwise it will be enqueued in frame parent(wrong place)
echo '';
}
// not edit mode
else {
//print people grid inline CSS without attaching it to any style
//credits to https://www.cssigniter.com/late-enqueue-inline-css-wordpress/
wp_register_style( 'a13-people-grid-'.esc_attr($id), false );
wp_enqueue_style( 'a13-people-grid-'.esc_attr($id) );
wp_add_inline_style( 'a13-people-grid-'.esc_attr($id), $css );
}
}
}
}