Cross Sell Slider
'crosssell',
'posts_per_page' => 3,
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'cross_sell_type',
'value' => $type,
'compare' => '='
)
),
);
return new WP_Query($args);
}
$personal_query = $show_tabs || $force_personal ? lsg_get_crosssells_by_type('personal') : null;
$business_query = $show_tabs || $force_business ? lsg_get_crosssells_by_type('business') : null;
$default_image = '';
if ($force_personal && $personal_query && !empty($personal_query->posts)) {
$default_image = get_field('cross_sell_image', $personal_query->posts[0]->ID);
} else if ($force_business && $business_query && !empty($business_query->posts)) {
$default_image = get_field('cross_sell_image', $business_query->posts[0]->ID);
} else if ($show_tabs) {
if ($personal_query && !empty($personal_query->posts)) {
$default_image = get_field('cross_sell_image', $personal_query->posts[0]->ID);
} else if ($business_query && !empty($business_query->posts)) {
$default_image = get_field('cross_sell_image', $business_query->posts[0]->ID);
}
}
if (!$default_image) {
$default_image = 'https://placehold.co/800x800';
}
?>
$acc_index = 0;
while ($personal_query->have_posts()) {
$personal_query->the_post();
$acc_index++;
$text = get_field('cross_sell_text');
$btn_text = get_field('cross_sell_button_text');
$btn_link = get_field('cross_sell_button_link');
$heading_id = 'crosssellAccHeading-' . $acc_index;
$collapse_id = 'crosssellAccCollapse-' . $acc_index;?>
have_posts()) {
$acc_index = 0;
while ($business_query->have_posts()) {
$business_query->the_post();
$acc_index++;
$text = get_field('cross_sell_text');
$btn_text = get_field('cross_sell_button_text');
$btn_link = get_field('cross_sell_button_link');
$heading_id = 'businessCrosssellAccHeading-' . $acc_index;
$collapse_id = 'businessCrosssellAccCollapse-' . $acc_index;?>




