Community Forums › Forums › Design Tips and Tricks › Drop Down (Jump Box) for Pages
This topic contains 4 replies, has 2 voices, and was last updated by anitac 6 months, 2 weeks ago.
-
AuthorPosts
-
November 20, 2012 at 5:26 pm #987
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 postsDecember 2, 2012 at 8:50 pm #2938Try 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>December 2, 2012 at 8:54 pm #2940Thank 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 postsDecember 2, 2012 at 9:37 pm #2949You 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.
December 2, 2012 at 9:38 pm #2952Oh, 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 -
This reply was modified 6 months, 2 weeks ago by
-
AuthorPosts
You must be logged in to reply to this topic.