- Md Sadiqur Rahman on February 20, 2017 at 6:30 pm #7378
I am looking for a way to get a dropdown list of some “certain” pages (not all!) with a submit button. Can anyone help me out?
Md Sadiqur Rahman
- Brajesh Singh on February 20, 2017 at 6:46 pm #7380
you can use the following code
<?php wp_dropdown_pages( array('include'=> array( 2,3,4 ) ) );?>
Please make sure to pass the correct page ids in the inclide array.
Hope that helps.
- Md Sadiqur Rahman on February 20, 2017 at 9:48 pm #7391
Thank you so much for your quick reply. Unfortunately, I do not know how to implement that code. If you can give me a little more details that would help to solve the problem.
- Brajesh Singh on February 20, 2017 at 11:29 pm #7396
I am sorry if it was not very clear.
As you mentioned you wanted the code to show dropdown and a submit form, the above code will show a dropdown wherever you put it.
You can put it inside any form and add the submit button. You will have to handle the form action yourself though.
Hope that clarifies.
- Md Sadiqur Rahman on February 21, 2017 at 10:54 am #7406
Thank you so much for kind reply. I hope I will be able to solve the rest. Wish you a good day 🙂
- Brajesh Singh on February 21, 2017 at 12:39 pm #7409
You are welcome 🙂 All the best!
The topic ‘Get drop downlist of “certain” pages’ is closed to new replies.