BuddyDev

Search

Get drop downlist of “certain” pages

  • Participant
    Level: Initiated
    Posts: 10
    Md Sadiqur Rahman on #7378

    Hi there,
    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?

    Thank you
    Md Sadiqur Rahman

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #7380

    Hi,
    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.
    regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Md Sadiqur Rahman on #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.

    Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #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.

  • Participant
    Level: Initiated
    Posts: 10
    Md Sadiqur Rahman on #7406

    Thank you so much for kind reply. I hope I will be able to solve the rest. Wish you a good day 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #7409

    You are welcome 🙂 All the best!

The topic ‘Get drop downlist of “certain” pages’ is closed to new replies.

This topic is: not resolved