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
- MySQL “Or” Condition
- start_lvl Ignored in Custom walker_nav_menu
- Menu Items Disappearing
- wp_delete_auto_drafts() deletes links in menus
- Check if a menu is empty?
- Walker class: Problems with understanding how walk() method can be called without error
- Replacing a specific menu item
- How can I access the “description” of a menu item?
- Second select list values are not saved after clicking update
- Have CSS Class Added with `is_page()` WP function
- Run a filter when a walker runs
- Input type search in Menu
- WP Walker using custom css classes
- Change list item content in menu navigation to add a child element with specific class
- Custom profile field with birthday. Troubles with
- How to remove role=”navigation” from all nav elements?
- Long running queries
- Child page menu in sidebar
- Title Case WordPress Menu Items
- how to save selected option in variable for rest api category filter
- Trying to store submenu items to render out after main menu
- How to change menu order item
- get_the_title() gets printed out twice
- How to convert select to HTML with PHP tags inside of it [closed]
- Two menus show up
- How to remove dropdown from wp_nav_menu
- Show About and Contact Us page when they’re clicked in the top menu.
- add onchange to select in a wp form
- Parsing Menu Items and Blog Posts
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- How to display different submenus?
- Get css class of menu item in custom menu structure
- posts_nav_link pulling in multiple post types
- Make next post button link to random post
- Show login greeting above sub-menu links?
- Menu not styling. New menus functionality giving me a headache
- Adding a navigation page state to individual blog and portfolio pages
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- Providin exception to WordPress wp_nav_menu Custom CSS Classes
- Dropdown category field inside repeatable metabox
- Adding markup to sub menu based on class
- How to put 2 php codes in functions.php without site crashing
- Menu not updating for logged in users after redirect
- wp_get_nav_menu_items() with ACF
- How to switch between two primary menus (programatically0
- Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]
- How to give custom roles the capability to edit one Menu instead of every Menu
- Primary navigation menu with timed items from custom post type
- Add parent menu item in sub-menu in custom nav_walker
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- How limit the width of a fixed menu-bar on scroll?
- Two theme locations for two menus, but only one is showing up
- Contact form field in wordpress menu
- Add extra markup to WP menus
- How to call a certain object/menubar in a PHP file
- How to change the menu color
- How do I modify the with wp_nav_menu()
- Make a permalink to the most recent blog post
- Custom nav with bootstrap dropdown