• Resolved pelicanpaul

    (@pelicanpaul)


    Hi,

    I have one instance of a website where I have a mega menu. In that mega menu I have implemented a custom shortcode.

    [sf_categories parent=”2225″ columns=”4″]

    On a MediaTemple server running php 5.xxx it works fine. When migrated to WP-Engine the shortcode does not fire. and instead of the result it does not call the shortcode. Is this some setting?

    The shortcode in my functions.php file is

    function sf_categories($atts){

    $a = shortcode_atts( array(
    ‘parent’ => 0,
    ‘menu_class’ => ‘menu parent-menu’,
    ‘columns’ => 1

    ), $atts );

    gc_woo_cats($a[‘parent’],$a[‘menu_class’],$a[‘columns’]);

    }

    add_shortcode( ‘sf_categories’, ‘sf_categories’ );

    Go to: https://savoirfaire1.wpengine.com/ and click on Surfaces…

    thanks,

    Paul

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pelicanpaul

    (@pelicanpaul)

    Figured it out. I had to add

    add_filter( ‘widget_text’, ‘shortcode_unautop’);
    add_filter( ‘widget_text’, ‘do_shortcode’);

    to my functions file

    Plugin Author megamenu

    (@megamenu)

    Hi Paul,

    Good to hear you got it fixed.

    I like what you have done with the sub menu. As a side note/observation, you could add the Painting, Brushes etc items as actual menu items (children of Product Categories) rather than outputting them as widgets. Those sub menu items will show up in the mega menu builder so you can arrange them into 2 rows/4 columns as you have the widgets. Either way it is a nice effect with the transparent background!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom HTML Widget – Use shortcodes’ is closed to new replies.