Retrieve menu item filed values respectively within php loop

I create custom Navwalker for my them and i added the checkbox with select tag for showing the full width dropdown menu. All fields are work correctly

i put this code below within custom walker class in public function start_el() {}

My problem with $item->columnwidth Field

For example i have three menu item the value of $item->columnwidth = 6 , $item->columnwidth = 4 and $item->columnwidth = 3 respectively for three menus item

I want when loop retrieve the first menu item put the 6 in $divide_to variable like this $divide_to = 12 / 6 then put 4 and 3 for second and third menu item

But in my code retrieve all three values of $item->columnwidth like this 643
Means put all three values in $divide_to variable like this $divide_to = 12 / 643

How i can create a loop for retrieve every menu item value alone?

`if (!empty($item->normalwidth)) {
	$item_output .= '<ul class="dropdown-menu">';
	$item_output .= '<li>';
	$item_output .= '<div class="YPE-BSNAVBAR-container">';
	$item_output .= '<div class="row">';
		
	$divide_to = 12 / $item->columnwidth;

	for ($i=0; $i<$divide_to; $i++) {
		$item_output .= '<div class="col-sm-'.$divide_to.'">SHWAN</div>';
	}

	$item_output .= '</div>';
	$item_output .= '</div>';
	$item_output .= '</li>';
	$item_output .= '</ul>';
}`

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.