• Resolved mominet

    (@mominet)


    Hello everyone,
    I tried to enable Max Mega Menu for the main menu of the ColorMag theme, but in the mobile view instead of there being only one trigger to enable the mobile menu I get two

    In practice, the first is what the theme would have by default but nothing happens if I click on it, the second is that of Max Mega Menu and enables the Slide Right.

    How can I make sure there is only one trigger on the bar?

    I See https://www.megamenu.com/documentation/i-see-two-mobile-toggle-buttons/

    but in reality the trigger of the theme doesn’t let me work, but it simply supports it with the complete menu that expands vertically, not doing the right slide function

    The site is fantasvaimec.it,
    currently on the public site I have not made this change for obvious reasons.

    Thank you

    • This topic was modified 1 year, 11 months ago by mominet.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter mominet

    (@mominet)

    I put the recommended code here in the function.php file

    https://www.megamenu.com/documentation/colormag/

    but it gives me an unrecoverable error, it’s the first time I’ve edited that file, could I have made some mistake?
    I simply edited with a text editor pasting the code and replaced the file

    Plugin Author megamenu

    (@megamenu)

    Hi mominet,

    Did you create a child theme first?

    https://developer.www.ads-software.com/themes/advanced-topics/child-themes/

    There are also plugins that make creating a child theme easy (search for ‘child theme creator’.

    Once you have done that, add the code to functions.php. If it still triggers an error, please paste the contents of the file here so I can check it.

    Regards,
    Tom

    Thread Starter mominet

    (@mominet)

    Hi Tom,
    yes, I work on child theme.

    I simply pasted the function.php file into the existing text, which looks like this:

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
    if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
        function chld_thm_cfg_locale_css( $uri ){
            if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
                $uri = get_template_directory_uri() . '/rtl.css';
            return $uri;
        }
    endif;
    add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
    
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
        function chld_thm_cfg_parent_css() {
            wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array(  ) );
        }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
    
    // END ENQUEUE PARENT ACTION
    
    function colormag_below_header_bar_display() {
    	?>
    	<nav id="site-navigation">
    		<div class="inner-wrap clearfix">
    			<?php wp_nav_menu( array( 'theme_location'  => 'primary' ) ); ?>
    		</div>
    	</nav>
    	<?
    }

    I open it with notepad, paste the code and save.
    Once the functions.php file has been replaced, it gives me a critical error, putting the unmodified one back in its place, everything is ok again

    Plugin Author megamenu

    (@megamenu)

    I have tested locally and the code is working for me now. Before i go into that further, I don’t see MMM enabled for your main menu at the moment, and that code is only required if you do enable MMM on your main menu. Are you planning on doing that? If not, you can leave your site as it is.

    Regards,
    Tom

    Thread Starter mominet

    (@mominet)

    I was testing it out on a development site before making live changes that might confuse users ??

    Could this somehow be the problem?

    The structure is practically the same only that the development one has no pointed domain

    Plugin Author megamenu

    (@megamenu)

    Hi mominet,

    I don’t think so. Can you check your server error logs to get the actual error message? Also try making the change through WordPress, under Appearance > Theme Editor (instead of using notepad). Bear in mind you might need to revert the change using ftp if you get a white screen error.

    Regards,
    Tom

    Thread Starter mominet

    (@mominet)

    I tried through the theme editor but it won’t let me change it and tells me to do it via ftp, however by changing it from the hosting file manager I still get an error.

    The error is

    Parse error: Unclosed '{' on line 26 in /home/uXXXXXXXXX/domains/fantasvaimec.tech/public_html/wp-content/themes/colormag-child/functions.php on line 34
    Plugin Author megamenu

    (@megamenu)

    Ah, I think I see it. Your server doesn’t support short opening tags for PHP.

    Please try the now updated code on this page:

    https://www.megamenu.com/documentation/colormag/

    Regards,
    Tom

    Thread Starter mominet

    (@mominet)

    Great, it works ??

    Out of curiosity, even if I still invent something for a quick key to return to the Home, but does this code also eliminate the Colormag “house” which is used to return to the Home?

    Also removes the search and the random article as well as the image at the following links?

    https://drive.google.com/file/d/12UAwVcGur8YuHNz_AO1db7W_a42lVGbQ/view?usp=share_link

    https://drive.google.com/file/d/1rn6QRHFvT_1FovvmBxB1iVx-GHhWgKDj/view?usp=share_link

    Then I also have more to ask but let’s start with this ??

    Thank you

    Plugin Author megamenu

    (@megamenu)

    Hi,

    The code will replace the entire theme menu section with MMM. You would need to add back in the home link as a menu item and the search can be done with MMM Pro, or I’m sure there are free plugins that can also add the search in. I’m not sure about the random article, sorry.

    Regards,
    Tom

    Thread Starter mominet

    (@mominet)

    No problem, actually it’s fine like this, it was just for curiosity and to understand everything ??

    For the Home, as you said, I solved it by adding a menu item, the causal item is not important, for the search, if anything, I’ll see or in any case, given the potential, I don’t rule out switching to MMM Pro ??

    Now I’m preparing the theme locally and then I’ll apply MMM to the online site, then I’ll probably bother with other questions :))

    Thank you

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Trigger in ColorMag Theme Menu Bar’ is closed to new replies.