How to create drop down for child categories of current taxonomy being viewed?

Ok well without any help from here……. I was able to figure out how to change the option and select values of wp_dropdown_categories to display the child terms of the current taxonomy being viewed- First I placed this code into my functions file, which creates a walker class – class SH_Walker_TaxonomyDropdown extends Walker_CategoryDropdown{ function start_el(&$output, … Read more

Tags as a dropdown with set tags

You can use wp_dropdown_categories() to create your dropdown: wp_dropdown_categories(array(‘taxonomy’=> ‘post_tag’,’hide_empty’ => 0, ‘name’ => ‘my_tags’)); Update the reason you are getting the term ID is because wp_dropdown_categories sets the ID’s as values so instead of just echo’ing it out you need to get the term, something like: $term = get_term_by(‘id’,$your_id,’post_tag’); echo $term->name;

Filters post in admin with dropdown select, custom post type

Thank you so much, it’s working. Here is my modified code: function wpse45436_posts_filter( $query ){ global $pagenow; $type=”post”; if (isset($_GET[‘post_type’])) { $type = $_GET[‘post_type’]; } if ( ‘post’ == $type && is_admin() && $pagenow ==’edit.php’ && isset($_GET[‘ADMIN_FILTER_FIELD_VALUE’]) && $_GET[‘ADMIN_FILTER_FIELD_VALUE’] != ” && $query->is_main_query() ) { $query->query_vars[‘meta_key’] = ‘n_de_ldition’; $query->query_vars[‘meta_value’] = $_GET[‘ADMIN_FILTER_FIELD_VALUE’]; } } By targetting … Read more

Display custom taxonomy as dropdown list

Below is the easiest solution I use for displaying custom taxonomy as the dropdown instead of checkboxes. 1/ Use third party WordPress plugin ‘ACF’ to create the taxonomy ‘Relational’ field type and display it as dropdown as shown in below screenshot. https://wordpress.org/plugins/advanced-custom-fields/ For displaying taxonomy selected you can refer documentation of ACF for relational taxonomy … Read more

Custom widget using get_categories select menu dropdown

Ok I found a solution thanks to this: Using wp_dropdown_categories in widget options Here is the code I used instead: function form( $instance ) { /* Default Widget Settings */ $defaults = array( ‘title’ => ‘Highlight Category’ ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <!– Widget Title –> <p> <label for=”<?php echo $this->get_field_id( … Read more

Customize the Sorting Dropdown in WooCommerce

Actually, with a little digging this is quite easy to do. WooCommerce has already set up a filter so all you have to do it add a small snippet in your functions.php file. // Modify the default WooCommerce orderby dropdown // // Options: menu_order, popularity, rating, date, price, price-desc function my_woocommerce_catalog_orderby( $orderby ) { unset($orderby[“price”]); … Read more

Replacing the NavWalker dropdown element

You need to replace the end_lvl method of Walker_Nav_Menu as well. This is what you would need to add: public function end_lvl( &$output, $depth = 0, $args = array() ) { if ( isset( $args->item_spacing ) && ‘discard’ === $args->item_spacing ) { $t=””; $n = ”; } else { $t = “\t”; $n = “\n”; … Read more

Add filter to wp_dropdown_pages() or wp_dropdown_categories() – no select container?

A filter called wp_dropdown_pages exists in the wp_dropdown_pages() function. That filter allows you to modify the output of the function. However, for the thing you want to do I would not recommend using this filter since this will apply to all code that calls wp_dropdown_pages(), including plugins. So, one way to approach your situation may … Read more

Dropdown list of a custom post type

You’ll need to use get_posts and roll your own drop down. Something like this (somewhere in functions.php): <?php function wpse34320_type_dropdown( $post_type ) { $posts = get_posts( array( ‘post_type’ => $post_type, ‘numberposts’ => -1 ) ); if( ! $posts ) return; $out=”<select id=”wpse34320_select”><option>Select a Doctor</option>”; foreach( $posts as $p ) { $out .= ‘<option value=”‘ . … Read more

How to Create a Custom WordPress Navigation Menu with the Code?

Well first of all you can use the menu feature in the newer WordPress. First you want to activate the fact that you want to use this feature via your functions.php file. // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( ‘primary’ => __( ‘Primary Navigation’, ‘your_theme_name’ ), ‘secondary’ => __(‘Secondary Navigation’, ‘your_theme_name’) ) … Read more

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