we are want to pass value in url when we click om menu in
<?php wp_nav_menuservice(array('menu' => '27')); ?>
function
click on menu , current output in url:
http://localhost/daffodilsite/?page_id=540
and we want in url:
http://localhost/daffodilsite/?page_id=540&cityid=3

please help me how to pass cityid in url

thanks
Rajeev Dhar

I assume you need to dynamically add the city id to the navigation item. If you do, then I think you're going to need to write and pass a custom walker to the wp_nav_menu function.

Also, bear in mind that just because WordPress provides a menu function, it doesn't mean it is the right tool to use. The menu is meant largely for static menus, rather than those that are dynamically generated. You might be just as well writing a class to render you own.

If the city id value is always going to remain the same, you can add it via the admin panel under appearance > menus

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.