I want to add a custom menu item to the main navigation menu, On clicking this item I want to open a lightbox form. I have the form-shortcode ready to be placed but on a page but I don't know how to do this in the main navigation menu, i have used cforms-II for the form and lightbox form to display it in lightbox modal. please help. i'm using wordpress 3.5
Note: I may need to change my theme in recent future so I would like the solution to programtically do this.Thanks.
Edit: I'm trying to use the following code:
add_filter()
to add menu item, and for light box form i have this code:
add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );
function my_custom_menu_item ( $items, $args ) {
if (is_single() && $args->theme_location == 'primary') {
$items .= '<li>Show whatever</li>';
}
return $items;
}
[formlightbox_call title="Get free quote" class="4"]here[/formlightbox_call]
[formlightbox_obj id="4" style="padding: 10px; width:350px"][contact-form-7 id="848" title="Contact form 1"][/formlightbox_obj]