Do you work with Bootstrap? What you might want to do is make a hidden modal in your templates HTML/PHP with a ninja-form php shortcode in it.
<?php do_shortcode="[ninja_form id=x]"; ?>
You only need to add some attributes to your contact us menu link via this hook in the case of the Bootstrap modal. In the case you create your own modal you can make your own javascript function based on the menu item class of that item.
add_filter( 'nav_menu_link_attributes', 'wpse121123_contact_menu_atts', 10, 3 );
function wpse121123_contact_menu_atts( $atts, $item, $args )
{
// The ID of the target menu item
$menu_target = 123;
// inspect $item
if ($item->ID == $menu_target) {
$atts['data-toggle'] = 'modal';
}
return $atts;
}
-
This reply was modified 8 years, 5 months ago by
Levdbas.