I have a question as to how I could declare in the code below for if the megamenu function is for col-3 it performs a function and if it is for col-4 it will execute another, the default function is col-4, I need it to be Distinct in one situation and another, thanks

Code is:

$id = apply_filters( ‘nav_menu_item_id’, ‘menu-item-‘ . $item->ID, $item, $args );

    $id = $id ? ' id="' . esc_attr( $id ) . '"' : '';



    $startup_mega_menu_start = $startup_mega_section_start = '';

    global $startup_mega_section;

    global $startup_mega_menu;



    if ( $depth == 0 ) {



        foreach ( $classes as $class ) {

            if ( trim( $class ) == "megamenu" ) {

                $mega_col = '';

                if ( $mega_count != 0 ) {

                    if ( $mega_count >= 4 ) {

                        $mega_col = ' col-4';

                    } else {

                        $mega_col = ' col-' . $mega_count;

                        }

                }



                $startup_mega_menu_start = '<div class="megamenu-container' . $mega_col . '">';

                $startup_mega_menu       = 1;

            }

        }

    }

Read more here: Different megamenu columns


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: