• Resolved nklsbrn

    (@nklsbrn)


    Hey,

    I have troubles when I try to use the text widget of the grid layout to show certain woocommerce products.

    This is how it looks like:
    https://ibb.co/nChMMe

    The 3 Products at the top are placed in the mega menu. It seems like the html and css is not loaded correctly (No button, no link).

    Thats the Shortcode i am using. It does work perfectly on normal pages.
    [products ids=”191″ columns=”1″]

    can you please help me?

    Best regards
    Niklas

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi Niklas,

    Please can you post a link to your site so I can compare the HTML thats being output on the page?

    Regards,
    Tom

    Thread Starter nklsbrn

    (@nklsbrn)

    Hello Tom,

    Thanks for your fast reply. Thats the Link to the Page.

    http://drahtseil24.de.w0135547.kasserver.com/

    (Its just the “Saveking” Item which is activ)

    BR
    Niklas

    • This reply was modified 7 years, 11 months ago by nklsbrn.
    Plugin Author megamenu

    (@megamenu)

    Hi Niklas,

    Under Mega Menu > Menu Themes, can you uncheck “Reset Widget Styling”?

    That should get things looking better, but I may need to take another look after that.

    Regards,
    Tom

    Plugin Author megamenu

    (@megamenu)

    Hi Niklas,

    Ah, I see why you have turned on that option now.

    You will also need to copy your themes header.php file (or the file responsible for outputting the main navigation) to your child theme and remove this class:

    https://screencast.com/t/1sGerqkHJ

    Regards,
    Tom

    • This reply was modified 7 years, 11 months ago by megamenu.
    Thread Starter nklsbrn

    (@nklsbrn)

    Hi Tom,

    after unchecking the “Reset Widget Styling”, nothing but the text is shown in the megamenu.

    Could you please take a look?

    BR,
    Niklas

    Plugin Author megamenu

    (@megamenu)

    Hi Niklas,

    Please check my last reply also. Once that class is removed it should display correctly 🙂

    Regards,
    Tom

    Plugin Author megamenu

    (@megamenu)

    Hi Niklas,

    I’ve taken a closer look at GeneratePress and can see it’s not quite that simple to change that class.

    Please make a child theme, and in the child themes functions.php file, add:

    function mega_menu_remove_main_navigation_class($classes, $class) {
    
    	$new_classes = array();
    
    	foreach ($classes as $class) {
    		if ($class == 'main-navigation') {
    			$new_classes[] = 'main-navigation-mmm';
    		} else {
    			$new_classes[] = $class;
    		}
    	}
    
    	return $new_classes;
    }
    add_filter('generate_navigation_class', 'mega_menu_remove_main_navigation_class', 10, 2);

    Regards,
    Tom

    Thread Starter nklsbrn

    (@nklsbrn)

    Hi Tom,

    thank you so much for helping me.

    I was trying integrate the code with the code snippets plugin. It says:

    The code snippet you are trying to save produced a fatal error on line 14:
    Cannot redeclare mega_menu_remove_main_navigation_class() (previously declared in /www/htdocs/w0135547/drahtseil24.de/wp-content/plugins/megamenu-edit/megamenu-edit.php:13)

    Can you tell me whats wrong here?

    Regards,
    Niklas

    Plugin Author megamenu

    (@megamenu)

    Hi Niklas,

    Here is an alternative solution which should be a bit easier.

    Please go to Appearance > Customize > Additional CSS and add the following:

    .mega-menu-primary .main-navigation ul ul {
        height: auto;
        background: transparent;
        position: relative;
        left: auto;
        width: auto;
        box-shadow: none;
        pointer-events: auto;
        opacity: 1;
    }

    Regards,
    Tom

    Thread Starter nklsbrn

    (@nklsbrn)

    Hi Tom,

    thank you so much! That works perfectly!

    Regards,
    Niklas

    • This reply was modified 7 years, 11 months ago by nklsbrn.
Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Woocommerce Shortcodes in the grid layout’ is closed to new replies.