Using a shortcode to create a dropdown menu from wp_nav_menu list items

You can use wp_get_nav_menu_items() which retrieves all menu items of a navigation menu. Your shortcode callback should be something like this . function print_menu_shortcode($atts, $content = null) { extract( shortcode_atts( array( ‘name’ => null, ‘class’ => null ), $atts )); // Assuming $name contains slug or name of menue $menu_items = wp_get_nav_menu_items($name); // Sample Output. … Read more

Get the selected option from drop down list

I have been searching and trying many suggestions I found, but until now nothing seems to be doing the trick. If possible I want to get this done in php (value needs to be in $ to build db-query). Your course selection drop-down must be enclosed within a <form> tag with a submit button, like … Read more

Populate dropdown from database

If that testing_db is your WordPress database, then you should use the WordPress wpdb API/class to interact with the data in your custom table (wp_tmadm_dojangs). So if this is how you do it in “regular PHP”, i.e. using native PHP functions: $sql = mysqli_query($conn, “SELECT dojangName FROM wp_tmadm_dojangs”); while ($row = $sql->fetch_assoc()){ $dojang = $row[‘dojangName’]; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)