Sunday, November 13, 2022
HomeWordPress Developmenttaxonomy - Group customized taxonomies primarily based on tags contained of their...

taxonomy – Group customized taxonomies primarily based on tags contained of their posts


I’ve a bit of code that reveals hyperlinks to kids of a father or mother taxonomy on archive pages. My objective nevertheless is to separate these kids into teams, primarily based on the tags (normal WordPress tags).

My customized taxonomy is “Graphic Playing cards”, and it has two mother and father “NVidia” and “AMD”, and every has a bunch of kids.

Proper now the code beneath reveals both all kids of NVidia or all kids of AMD, however I wanna have the ability to separate each NVidia and AMD into tags. Every publish containing these graphic playing cards can be tagged with tags “desktop GPU” or “pocket book GPU”.

                <?php 

                $term_id = get_queried_object()->term_id;
                $father or mother = get_queried_object()->father or mother; 
                $time period = get_term($father or mother, 'graphic-cards' );
                $args = array(
                    'orderby' => 'identify', 
                    'order' => 'ASC',
                    'hide_empty' => true,
                    'child_of' => $term->term_id,
                    'father or mother' => $term->term_id,
                ); 
                $sub_terms = get_terms( 'graphic-cards', $args);
                foreach ($sub_terms as $time period) { ?>
                <a sort="button" class="btn btn-gcard me-2 mb-2" href="<?php echo get_term_link( $time period ); ?>"><?php echo $term->identify; ?></a>
                <?php } ?>

So As a substitute of getting AMD Gpus – 5600, 6600m, 7600

I need to be getting – AMD Gpus (Desktop) 5600,7600 (Pocket book) 6600m

Is that this achievable, or I am considering incorrect about it?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments