How to add Querystring on WordPress Menu

Hello Dear All Friends, recently in one of my project i got one confusion that how to add query string on my default WordPress menu. and than after i plan to create some code for that permanent solution and that i did at last.

We all knows that we can easily add custom link from WordPress menu from admin side but on my situation i want to add session value so that’s not possible from custom link on WordPress default menu custom link.. so lets i explain you what i was looking earlier

i was looking to perform like this in earlier days:

and in that language i was getting on session so using below code i got its perfect solution and we can add any type of query string on wordpress menu at last using below code..the above is just example that i show you..

if you are familiar with wordpress default menu function wp_nav_menu than you know we are adding like this function

wp_nav_menu( array( ‘theme_location’ => ‘primary-menu’, ‘menu_class’ => ‘nav navbar-nav navbar-right’ ) );

to display wordpress menu.. you need to only change you menu name instead of primary-menu name if its different on your otherwise it will works..

Thats it :)