Get children of taxonomies

not actually sure what you are trying to achieve with the code. I would write something like this to get the child terms $terms = get_terms([ ‘taxonomy’ => array(‘Movies, Musics, Books, Games’), ‘parent’ => 0, ‘hide_empty’ => false, ]); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { foreach ($terms as … Read more

display taxonomy terms with link

You’ll need to use get_term_link(), e.g. change your $terms array to be HTML for the terms or links instead: foreach( $taxonomy_terms as $term ) { $term_link = get_term_link( $term->slug, $taxonomy ); if (! is_wp_error( $term_link ) ) { $terms[] = ‘<a href=”‘ . esc_url( $term_link ) . ‘”>’ . esc_html( $term->name ) . ‘</a>’; } … Read more

Custom taxonomy terms hierarchical navigation

I managed to find a solution myself. This code is to be used in taxonomy templates. PHP: function show_taxonomy_navigation( $post_type=”post”, $taxonomy = ‘category’, $parent = 0 ) { $html = get_taxonomy_hierarchy( $post_type, $taxonomy, $parent ); echo $html; } function get_taxonomy_hierarchy( $post_type, $taxonomy, $parent = 0, $depth = 0 ) { $taxonomy = is_array( $taxonomy ) … Read more

Custom Post Type Archive Page showing as 404

While registering custom_post_type use this parameters too. ‘publicly_queryable’ => true, Then it should be look like this. function wporg_custom_post_type() { register_post_type(‘proctor-work’, array( ‘labels’ => array( ‘name’ => __( ‘Works’, ‘textdomain’ ), ‘singular_name’ => __( ‘Work’, ‘textdomain’ ), ), ‘public’ => true, ‘has_archive’ => true, ‘rewrite’ => array( ‘slug’ => ‘proctor-work’ ), // my custom slug … Read more