';
/*Featured Post Beside Slider*/
$supermag_beside_slider_ids = array();
$supermag_beside_adds = array();
$supermag_featured_main_layout = $supermag_customizer_all_values['supermag-feature-side-display-options'];
$supermag_feature_side_title_length = $supermag_customizer_all_values['supermag-feature-side-title-length'];
if( 'post-2-add-2' == $supermag_featured_main_layout ){
if( 0 != $supermag_customizer_all_values['supermag-feature-post-one'] ){
$supermag_beside_slider_ids[] = $supermag_customizer_all_values['supermag-feature-post-one'];
}
if( 0 != $supermag_customizer_all_values['supermag-feature-post-two'] ){
$supermag_beside_slider_ids[] = $supermag_customizer_all_values['supermag-feature-post-two'];
}
if( !empty($supermag_customizer_all_values['supermag-feature-add-one']) ){
$supermag_beside_adds[0]['supermag-feature-add'] = $supermag_customizer_all_values['supermag-feature-add-one'];
$supermag_beside_adds[0]['supermag-feature-add-link'] = $supermag_customizer_all_values['supermag-feature-add-one-link'];
}
if( !empty($supermag_customizer_all_values['supermag-feature-add-two']) ){
$supermag_beside_adds[1]['supermag-feature-add'] = $supermag_customizer_all_values['supermag-feature-add-two'];
$supermag_beside_adds[1]['supermag-feature-add-link'] = $supermag_customizer_all_values['supermag-feature-add-two-link'];
}
}
elseif( 'from-category' == $supermag_featured_main_layout ){
$supermag_feature_side_from_category = $supermag_customizer_all_values['supermag-feature-side-from-category'];
if( 0 != $supermag_feature_side_from_category ){
$supermag_slider_side_args = array(
'post_type' => 'post',
'cat' => $supermag_feature_side_from_category,
'posts_per_page' => 4
);
}
}
elseif ( 'from-recent' == $supermag_featured_main_layout ){
$sticky = get_option( 'sticky_posts' );
$supermag_slider_side_args = array(
'post_type' => 'post',
'posts_per_page' => 4,
'ignore_sticky_posts ' => true,
'post__not_in' => $sticky
);
}
else{
/*do nothing*/
}
$supermag_float_fixed = 1;
if( 'post-2-add-2' == $supermag_featured_main_layout ||
'from-category' == $supermag_featured_main_layout ||
'from-recent' == $supermag_featured_main_layout ){
if( 'post-2-add-2' == $supermag_featured_main_layout ) {
if( empty( $supermag_beside_slider_ids ) ){
if( !empty( $supermag_beside_adds ) ) {
foreach ( $supermag_beside_adds as $supermag_beside_add_id){
?>
';
}
$supermag_float_fixed++;
}
}
}
else{
$sticky = get_option( 'sticky_posts' );
$supermag_slider_side_args = array(
'post_type' => 'post',
'posts_per_page' => 2,
'post__in' => $supermag_beside_slider_ids,
'orderby' => 'post__in',
'ignore_sticky_posts' => true,
'post__not_in' => $sticky
);
}
}
$beside_query = new WP_Query( $supermag_slider_side_args );
if ($beside_query->have_posts()) {
$supermag_no_image_post_thumb = get_template_directory_uri().'/assets/img/no-image-240-172.png';
while ($beside_query->have_posts()) {
$beside_query->the_post();
if (has_post_thumbnail()) {
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'post-thumbnail');
}
else {
$image_url[0] = $supermag_no_image_post_thumb;
}
?>
";
echo '
';
}
$supermag_float_fixed++;
}
}
wp_reset_postdata();
}
if( !empty( $supermag_beside_adds ) ) {
foreach ( $supermag_beside_adds as $supermag_beside_add_id){
?>
";
echo '
';
}
$supermag_float_fixed++;
}
}
echo '
';
echo '
';
}
endif;
add_action( 'supermag_action_feature_side', 'supermag_feature_side', 0 );