Drop Down (Jump Box) for Pages

Community Forums Forums Design Tips and Tricks Drop Down (Jump Box) for Pages

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  anitac 6 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #987

    anitac
    Moderator
    Post count: 3047

    I have 37 pages and their links that I need to add to a drop down/jump box. Is there an easy way to do this or a plugin? They are pages on the site and it would be nice to showcase those the same way the Category Drop Down box works.


    Need customization services or other help? Visit me here: Cre8tiveDiva.com | Twitter: @thecre8tivediva
    Why Not Take The Challenge! – Help us answer some of the unanswered posts

    #2938

    yakkas
    Participant
    Post count: 23

    Try this, where you include the ID’s of the pages (or you can use exclude & page ID’s)

    More info on wp_dropdown_pages

    <form name=”form1″ id=”form1″ action=”" method=”get”>
    <?php $select = wp_dropdown_pages(‘echo=0&include=31,149,20′);
    $select = preg_replace(“#<select([^>]*)>#”, “<select$1 onchange=’return this.form.submit()’>”, $select);
    echo $select; ?>
    <noscript><input type=”submit” name=”submit” value=”view” /></noscript>
    </form>

    #2940

    anitac
    Moderator
    Post count: 3047

    Thank you so much for responding. Do I place that in the theme or can I put it in a widget?

     


    Need customization services or other help? Visit me here: Cre8tiveDiva.com | Twitter: @thecre8tivediva
    Why Not Take The Challenge! – Help us answer some of the unanswered posts

    #2949

    yakkas
    Participant
    Post count: 23

    You can put it in a widget, if you use a plugin to allow php in widgets.

    Otherwise you can put this in a genesis hook (in this example ‘genesis_header_right’)  by adding this code to functions.php

    add_action (‘genesis_header_right’ , ‘pages_jump_menu’);

    function pages_jump_menu() {
    echo ‘<form name=”form1″ id=”form1″ action=”" method=”get”>’;
    $select = wp_dropdown_pages(‘echo=0&include=31,149′);
    $select = preg_replace(“#<select([^>]*)>#”, “<select$1 onchange=’return this.form.submit()’>”, $select);
    echo $select;
    echo ‘<noscript><input type=”submit” name=”submit” value=”view” /></noscript>’;
    echo ‘</form>’;
    }

    Or if using the simple hooks plugin, then just omit ‘add_action (‘genesis_header_right’ , ‘pages_jump_menu’);’ and add to required hook placement

    • This reply was modified 6 months, 2 weeks ago by  yakkas.
    • This reply was modified 6 months, 2 weeks ago by  yakkas.
    #2952

    anitac
    Moderator
    Post count: 3047

    Oh, thank you. I really appreciate the assistance.


    Need customization services or other help? Visit me here: Cre8tiveDiva.com | Twitter: @thecre8tivediva
    Why Not Take The Challenge! – Help us answer some of the unanswered posts

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.