Skip to content

Commit

Permalink
Merge pull request #536 from equalizedigital/SteveJonesDev/issue482
Browse files Browse the repository at this point in the history
Do we need the Number of Columns Settings field for the menu?
  • Loading branch information
SteveJonesDev authored Oct 24, 2023
2 parents 2ed878a + a9507fb commit 9f508b3
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions partials/content/header/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,24 @@

if ( $menu_items and is_array( $menu_items ) ) :
foreach ( $menu_items as $item ) {
$link = $item['link'];
$columns = $item['columns'];
$number_of_columns = $item['number_of_columns'];
$current_url = home_url( $_SERVER['REQUEST_URI'] );
$link = $item['link'];
$columns = $item['columns'];
$column_count = count( $columns );
$current_url = home_url( $_SERVER['REQUEST_URI'] );

switch ( $column_count ) {
case 1:
$number_of_columns = 'one column';
break;
case 2:
$number_of_columns = 'two column';
break;
case 3:
$number_of_columns = 'three column';
break;
default:
$number_of_columns = 'one column';
}
?>

<li class="main-nav-link-li
Expand All @@ -40,7 +54,7 @@
?>
">

<?php if ( '#' === $link['url'] ) { ?>
<?php if ( isset( $link[ 'url'] ) && '#' === $link['url'] ) { ?>
<button aria-label="<?php echo $link['title']; ?>" type="button" class="menu-item-main-link
<?php
if ( empty( $columns ) ) {
Expand Down

0 comments on commit 9f508b3

Please sign in to comment.