wp_dropdown_pages default value

I have a dropdown menu of pages, but after I go to a page selected, let’s say “About us”, the default title button of dropbown is the title of the page, “About us”, so i want the title/default option to be “Please select a page” or something like that. My code is this: wp_dropdown_pages(“title_li=&depth=1&sort_column=menu_order&child_of=”.$post->post_parent.”&echo=0&selected=$currPage”); What … Read more

How to retain the values from dropdown category lists after wrong form submission?

I can’t figure out the the code for – How to retain the values from dropdown category lists after wrong form submission? Any suggesstions, thanx in advance. <select class=”selectpicker btn-block” name=”coupon_cat” id=”category” > <option selected value=””> Категори Сонгох</option> <?php $args[‘exclude’] = “12,20”; // omit these two categories $categories = get_categories($args); foreach($categories as $category) { ?> … Read more

How to get a list of taxonomy terms which are being used only within certain post types?

I have a custom taxonomy called ‘locations’ which is being shared across a bunch of post types. I want to make a select field dropdown list of my locations (terms) to let users go to the taxonomy term page for each specific location; however I want to exclude some terms which are used in one … Read more

How to add country drop down menu to the user profile?

I’ve added this code snippet to my functions.php function my_new_contactmethods( $contactmethods ) { $contactmethods[‘country’] = ‘country’; return $contactmethods; } add_filter(‘user_contactmethods’,’my_new_contactmethods’,10,1); It works perfactly as I wanted. It show an extra field to fill up user country on user backend profile. But it just a text field. Actually I want to show this field as a … Read more

Add submenu using the bootstrap wp_nav_menu

I have a problem to generate a submenu using wp_nav_menu . How can I change the ClassA submenu generated by the wp_nav_menu for ClassA the Bootstrap ? see my problem: This is my code that generates the menu: <nav class=”row menu”> <?php wp_nav_menu( array( ‘theme_location’ => ‘category-menu’, ‘container’ => ”, ‘container_class’ => ”, ‘container_id’ => … Read more

Select dropdown not showing selected value php

I’m using WordPress Settings API. Everything works as it should except this select dropdown. When I select an option, the value echoed is correct but in the dropdown it displays the default first value i.e 6 and not the selected one. Where am I going wrong? public function someplugin_select() { $options = get_option( ‘plugin_252calc’); echo … Read more

Tags as a dropdown with set tags

Sorry if this is a silly question but is it possible to have a taglist as a dropdown? I have a page where users can post theyre own content, and I would like them to be able to choose certain tags as a dropdown, is this possible? Heres the page so you can see http://wordpress.art-williams.com/add-destination … Read more