What is the ‘selected’ parameter in wp_dropdown_categories() for?

The selected parameter just defines which option is selected when the select field is rendered. it’s an optional parameter that defaults to the current category or 0 $defaults[‘selected’] = ( is_category() ) ? get_query_var( ‘cat’ ) : 0; (https://developer.wordpress.org/reference/functions/wp_dropdown_categories/) This function is for rendering a category drop down, but you can override it to work … Read more

Show Taxonomy Child Terms (name and image) on Parent Term Page

You can try this. $parent_terms = get_terms( array( ‘taxonomy’ => ‘post_tag’, ‘hide_empty’ => false, ) ); foreach ( $parent_terms as $terms) { $term = get_terms(array( ‘taxonomy’ => ‘post_tag’, ‘hide_empty’ => false, ‘parent’ => $terms->term_id ) ); foreach ($term as $term_child){ $string .= ‘<li><a href=”‘ . get_term_link( $term_child->term_id ) . ‘”>’ . $term_child->name . ‘</a></li>’; } … Read more

IF taxonomy archive is hierarchical THEN

Look at the docs (please read the docs) for is_taxonomy_hierarchical(). You need to tell it which taxonomy you’re checking: if ( is_taxonomy_hierarchical( ‘my_taxonomy_name’ ) ) { } If you’re template isn’t specific to a taxonomy, and you need to know which taxonomy you’re viewing, use get_queried_object() to figure it out (you were already told how … Read more

get_term_link doesn’t work

I do not know how ACF works or how its data is stored, but in general, I would just use usort() to sort the returned array of terms via the ACF value of cognome_nome. Note that array_push is a bit expensive to use, so try to avoid that 😉 As I stated in comments, your … Read more

Taxonomy link not working (leads to 404 page)

It seems you do not have a template for your custom taxonomy. I do not think so single.php will be used for this purpose. Have a look on this ARTICLE.. Look at the hierarchy,,, I think in your case you need taxonomy-soortpost.php Taxonomy hierarchy: taxonomy-{taxonomy}-{term}.php taxonomy-{taxonomy}.php tag-{slug}.php tag-{id}.php category-{slug}.php category-{ID}.php