0
votes

I'm listing categories for a custom post type, which is going great so far.

The problem is when I get the category link, is linked to a default category archive template, and I'd like to link it to a custom-page-template. Is there a way to do that?

             <?php

                                //Llamar al catálogo

                                $taxonomy     = 'lookbook-category';
                                $orderby      = 'date';
                                $post_type      = 'post';


                                $args = array(
                                    'taxonomy'     => $taxonomy,
                                    'orderby'      => $orderby,
                                    'post_type'      => $post_type,

                                );
                                ?>

                                <?php 


                                    $categorias = get_categories($args);

                                // Mostrar categorías

                                    foreach ($categorias as $cat) {
                                                echo '<div class="temporadas-catalogo ">';
                                                echo '<h1 class="">'.$cat->name.'</h1>';
                                                echo '<p class="">'.$cat->description.'</p>';
                                                echo '<div class="center margin-top">';
                                                echo '<a class="button " href="'.get_category_link($cat).'">Ver Catálogo</a>';
                                                echo '</div>';
                                                echo '</div>';


                                        }

?>

1

1 Answers

0
votes

My assumptions are that you are using a custom Taxonomy called 'lookbook-category', with this you can set a custom taxononmy template like so:

taxonomy-{taxonomy}.php

The Wordpress developer docs is an excellent resource for understanding how the template hierarchy works.

https://developer.wordpress.org/themes/basics/template-hierarchy/