Show child pages by menu order using Superfish Dropdown menu?

I downloaded this plugin and took a look and it does work as advertised for me. The function it uses for displaying the page list is: wp_list_pages(array( ‘sort_column’=>’menu_order’, ‘depth’=>’4’, ‘title_li’=>”, ‘exclude’=>$exclude )); ?> Which is very straightforward and does very explicitly order the items via menu_order. However, because it’s a core function subject to actions … Read more

Bootstrap dropdown nav pills not working with wp_nav_menu()

I ran into similar problem when I created a bootstrap navigation menu and dropdown links were all showing up at once. I used the following steps to correct the issue: download navwalker from github repo link: https://github.com/wp-bootstrap/wp-bootstrap-navwalker put this file in the root folder of the theme and in the functions.php file userequire_once get_template_directory() . … Read more

how to get value of wp_dropdown_categories

We can get the categories via get_categories() function (which will get the same categories as wp_dropdown_categories() function), but as array and without the markup. As the value is returned as array, we can loop through the categories and generate the HTML ourself. Usually, we would aim for a structure like this: <select name=”categories”> <option value=”1″>Category … Read more

wp_dropdown_categories in custom post type with custom taxonomy

get post id $post_id=get_the_ID(); get selected region $terms = wp_get_post_terms( $post_id, $taxonomy ); $selected_id=”; if(isset($terms[0]->term_id)){ $selected_id=$terms[0]->term_id; } build hierarchical dropdown wp_dropdown_categories( array( ‘show_option_all’ => ‘Choose a region’, ‘show_option_none’ => ”, ‘orderby’ => ‘ID’, ‘order’ => ‘ASC’, ‘show_count’ => 0, ‘hide_empty’ => 0, ‘child_of’ => 0, ‘exclude’ => ”, ‘echo’ => 1, ‘selected’ => $selected_id, ‘hierarchical’ … Read more

Add a dropdown to theme customizer

Add Section to Theme Customizer: $wp_customize->add_section( ‘parsmizban_options’, array( ‘title’ => __( ‘Theme Options’, ‘parsmizban’ ), //Visible title of section ‘priority’ => 20, //Determines what order this appears in ‘capability’ => ‘edit_theme_options’, //Capability needed to tweak ‘description’ => __(‘Allows you to customize settings for Theme.’, ‘parsmizban’), //Descriptive tooltip ) ); Add new Setting: $wp_customize->add_setting( ‘bootstrap_theme_name’, //No … Read more

Custom Taxonomy as Dropdown in admin

This suppose you have a custom post type “sponsors” and a custom taxonomy “types”… function custom_meta_box() { remove_meta_box( ‘tagsdiv-types’, ‘sponsors’, ‘side’ ); add_meta_box( ‘tagsdiv-types’, ‘Types’, ‘types_meta_box’, ‘sponsors’, ‘side’ ); } add_action(‘add_meta_boxes’, ‘custom_meta_box’); /* Prints the taxonomy box content */ function types_meta_box($post) { $tax_name=”types”; $taxonomy = get_taxonomy($tax_name); ?> <div class=”tagsdiv” id=”<?php echo $tax_name; ?>”> <div class=”jaxtag”> … Read more

Removing filter dropdown in posts table (in this case Yoast SEO)

These additional dropdowns are added via the restrict_manage_posts action hook. This means the dropdown output isn’t filterable, but you can remove the hooked action from Yoast SEO. The filter dropdown is added by the posts_filter_dropdown() method in the WPSEO_Metabox class. It’s added in the setup_page_analysis() method of the same class, which is hooked into admin_init … Read more