Add Images to Mega Menu

Home Forums Icelander Add Images to Mega Menu

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17702

    markitors
    Participant

    Add Images to Mega Menu

    Resolved

    I have a product megamenu on my site, and I am trying to add an image into the megamenu column. The easiest way to do it would be to insert an image into the description of the category. Using chrome developer tools and modifying the html directly, this worked remarkably well.

    Unfortunatly, WordPress does not allow html in menu descriptions, so this does not work. I want to avoid a javascript solution, so do you have any suggestions on how I should proceed? The easiest solution would be to instruct wordpress to allow html in the description. Do you know how to do this?

    #17703

    Oliver Juhas
    Keymaster

    Hi markitors,

    Probably the easiest solution would be to use a dedicated megamenu plugin. The theme megamenu was built for allowing simple menu columns only.

    If you, however, want to proceed with forcing WordPress to allow HTML in menu item description (by removing its filter), please use this code in your child theme‘s functions.php file:

    function child_theme_setup() {
      remove_filter( 'nav_menu_description', 'strip_tags' );
    }
    add_action( 'after_setup_theme', 'child_theme_setup', 100 );

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.