Group based routing and administration
I don’t see why you can’t multisite. On the main site you’d just need to switch_to_blog(), get content from one of the group blogs, then restore_current_blog().
I don’t see why you can’t multisite. On the main site you’d just need to switch_to_blog(), get content from one of the group blogs, then restore_current_blog().
Renaming default category taxonomy?
You can use another argument in the array of argument, you have many choice to filter the results. You can add exclude, include with an array or comma separated of the terms you want to display. $terms = get_terms( array( ‘taxonomy’ => ‘product_provider’, ‘include’=> array(‘X’, ‘Y’) ); But, if the results depends on the product_type, … Read more
It works the same way within any Loop for any post type and taxonomy, get_the_ID() retrieves the current post’s ID. Taken from the Codex basic example for get_the_terms: $terms = get_the_terms( get_the_ID(), ‘genre’ ); if ( $terms && ! is_wp_error( $terms ) ) { foreach ( $terms as $term ) { echo $term->name; } }
global $post; $terms = wp_get_post_terms($post->ID); foreach($terms as $term) { echo $term_single->name; }
Did you clear cache after making changes with trim()? Try with: str_replace( trim( $parent->name ), $link, $intro_text ); Are you sure that the term is Upbeat Electronic music and not UpbeatElectronic music? Try with this to be sure: str_replace( trim( $parent->name ), ‘ ‘ . $link, $intro_text );
The @PieterGoosen’s answer saved my life: add_action( ‘transition_post_status’, function ( $new_status, $old_status, $post ) { if( ‘publish’ == $new_status && ‘advert_tmp’ == $old_status && $post->post_type == ‘advert’ ) { $tags = get_post_meta( $post->ID, ‘advert_tags_field’, true ); $tags = explode( ‘,’, $tags ); if( !empty( $tags ) ) { wp_set_object_terms( $post->ID, $tags, ‘advert_tag’ ); delete_post_meta( $post->ID, … Read more
Ok, found it, sorry for the noise !… //fetch the terms of my tax $terms = wp_get_post_terms( $post->ID, ‘tool’); $terms_ids = []; //an array, which can contain several terms foreach ( $terms as $term ) { $terms_ids[] = $term->term_id; } // Query $args = array( ‘post_type’ => ‘technical_post’, ‘posts_per_page’ => 4, // How many items … Read more
Template hierarchy changes when custom post-type permalink leverages custom taxonomy
If you needed an archive page that listed all dogs, then the hierarchical approach would be much efficient. You could visit `/category/dogs’, and Bob’s your uncle. If you used separate categories for every breed of dog, then that dogs archive would require a custom query to select everything from every individual breed in the dogs … Read more