Looks like not many folks do this. Anyway here’s something that works for me to get drop-down select to go to WordPress page”
<?php
$my_title = $_POST['place'];
global $wpdb;
$mypost = $wpdb->get_row( "SELECT * FROM wp_posts WHERE post_title="" . $my_title . "" " );
$permalink = get_permalink($mypost->ID);
echo "<a href=$permalink><BR>Click Here to Go to Selection</a>";
?>
“place” is the name of the select. Once the selection is made and submitted, this opens the page with the same name as selected. The names in the select box have to be the same as page names. If it can’t find the page, you will get a 404, or whatever your item-not-found response is.
Related Posts:
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Replacing the NavWalker dropdown element
- Select dropdown not showing selected value php
- Logout and redirect using the WP Menu
- Second Navigation inside header
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- items_wrap not working
- Style wp_page_menu() items
- Change Navigation Bar based on logged in or not
- Multiple WordPress Menus that will only display all pages
- How to make drop down post title
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Menu Limitations
- Filter Select results based on selection
- Easiest way to add dropdown to a page
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- wp_dropdown_pages auto submit
- How to style one item from main navigation?
- Add login hyperlink to secondary navigation menu
- HTML dropdown setting not showing last saved value in the database
- Sorting dynamic select/dropdown for Contact Form 7 of Modern Tribe Events posts
- Menu Custom Data Attributes
- How to use wp_nav_menu to create custom dropdown menu?
- How to modify mobile nav menu text in theme
- Custom Taxonomy Select Menu: Setting default option value?
- Nav-Menu not showing up
- Custom navigation menu with awsAccordion
- Why can’t I add a custom image in my navigation?
- Remove the Tag from wp_nav_menu
- How to set value selected using select2 jquery plugin
- How to make a pagination with dropdown selection?
- How to set Nav as a default menu in wordpress
- Redirect User when they click Menu Option
- How to create a sub-page of sub-page?
- PHP drop down menu for my get_category child of
- Add the “.current-menu-item” class to tag?
- Nav Menu Display
- Custom Navigation Bar JSON Syntax Error in JSON at Position 0
- Nav menù doesn’t display selected pages
- how to save selected option in variable for rest api category filter
- Help with Sub and Sub-Sub Navigation
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Display parent and child taxonomies in separate drop down select fields
- Trying to store submenu items to render out after main menu
- How to change menu order item
- Custom Menus: dynamic highlighting problem with custom home link
- get_the_title() gets printed out twice
- Add item to top of menu using a filter in functions.php
- How to convert select to HTML with PHP tags inside of it [closed]
- Adding PHP in the menu
- Two menus show up
- How to remove dropdown from wp_nav_menu
- Register a menu – Error Header
- Show About and Contact Us page when they’re clicked in the top menu.
- add onchange to select in a wp form
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Parsing Menu Items and Blog Posts
- Isotope Drop Down Categories Filter Function
- Help with page nav?
- Automatically add images to a menu
- Why can’t I return a value from $wpdb->get var?
- Add value to new attribute inside WordPress menu items
- wp_nav_menu not working correctly in my underscores theme
- Menu Items fail to save correctly, cause reset of related page metadata
- Dropdown menu for categories
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- How to display different submenus?
- Get the name of menu item with wp_nav_menu
- How can I get “Previous” and “Next” to show in the navigation besides the links?
- Notice: Trying to get property of non-object
- Output only links using wp_nav_menu()
- Get css class of menu item in custom menu structure
- How to add aria role and schema markup to custom walker container
- How can I use custom menus with a Bootstrap WordPress theme?
- Nav menu from plugin to theme
- Adding Additional Variables on Menus Page
- Save the value of a wp_dropdown_pages
- Extend Menu Walker Output
- posts_nav_link pulling in multiple post types
- how to add a div inside wp_page_menu
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Why in this WordPress theme I can’t see the Main Menu?
- Make next post button link to random post
- Show login greeting above sub-menu links?
- Remove submenu item from list
- conditional: if is page, and all subpages
- wp nav menu: show submenu below li item
- How to tell if a user has gone in and created a menu
- Add a select-option to the default widgets
- go to home page when i select default in select-box
- Dynamic Menu drops pages?
- Class for Selected Menu using wp_nav_menu
- Menu not styling. New menus functionality giving me a headache
- Compare current post Category in select menu
- Styling an “active” link outside of WordPress default menu