Displaying Custom Taxonomy Children in Dropdown

You can use get_query_var( ‘term’ ) to get the current term and get_query_var( ‘taxonomy’ ) to get the current taxonomy, then all that is left is to use [wp_dropdown_categories()][1] function withchild_ofparameter andtaxonomy` parameter, so something like this: //first get the current term $current_term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); //then set … Read more

add slug of child(ren) to li using wp_list_pages

OK, I almost got it now… I extended the Walker_Page Class: class Walker_Child_Classes extends Walker_page { function start_el(&$output, $page, $depth, $args, $current_page) { if ( $depth ) $indent = str_repeat(“\t”, $depth); else $indent=””; extract($args, EXTR_SKIP); $output .= $indent . ‘<li class=”‘ . apply_filters( ‘the_title’, $page->post_name, $page->ID ) . ‘”><a href=”‘ . get_page_link($page->ID) . ‘” title=”‘ … Read more

How to get post id of first child of the same post type?

Instead of: $args = array( ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’, ‘post_type’ => ‘attachment’, ‘post_parent’ => $post->ID, ‘post_mime_type’ => ‘image’, ‘numberposts’ => 1, ); Use: $args = array( ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’, ‘post_type’ => get_post_type($post), ‘post_parent’ => $post->ID, ‘numberposts’ => 1, ); You could also use post/page/etc or ‘any’