if ( $home_blocks['type'] == "slider_banner" ) {
echo '<div class="om_home_sec_slider_main" style="margin:'.$home_blocks['settings']['margin'].';">';
foreach ($home_blocks['content'] as $slides_content) {
echo '<div>
<div class="row">
<div class="col-lg-7 d-flex flex-column">
<h3 class="mb-0 om_font_size_15 font-weight-bold slide_heading_mt">'.$slides_content['Heading'['text'].'</h3>
<span class="om_mid_txt_my om_font_size_08">'.$slides_content['paragraph'['text'].'</span>
<div class="d-flex home_slide_btn_div">';
$new_var = $slides_content['buttons'];
foreach( $new_var as $buttons) {
if ( $buttons['type'] == "delivery") {
echo '<button class="font-weight-bold om_font_size_02 om_btn_02 om_clor_white">'.$buttons['text'].'</button>';
}
else ( $buttons['type'] == "take_away") {
echo '<button class="font-weight-bold om_btn_05 om_font_size_02 om_clr_green">'.$buttons['text'].'</button>';
}
}
echo '</div>
</div>
<div class="col-lg-5">
<img class="mw-100" src="'.$slides_content['image'].'" alt="pic"/>
</div>
</div>
</div>';
}
Asked
Active
Viewed 15 times
0

aynber
- 22,380
- 8
- 50
- 63

Tayyab Noor
- 1
- 3
-
`else` blocks do not take arguments. You want `else if`. `$slides_content['Heading'['text']` and `$slides_content['paragraph'['text']` are completely incorrect. – aynber Dec 23 '21 at 13:56
-
You missed a closing bracket "}" at the end too. – Chalas Dec 23 '21 at 14:01