Displaying custom taxonomy list on archive page template

Community Forums Forums Design Tips and Tricks Displaying custom taxonomy list on archive page template

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  lucaslem 8 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #65875

    lucaslem
    Participant
    Post count: 88

    Hello,

    I would like to use the archive template as a sitemap to help users find content more quickly in list form. Can someone explain how to add my custom taxonomy list to the archive page?

    Thanks

    #73657

    Aaron Eaton
    Participant
    Post count: 28

    I would suggest creating a custom page template called ‘Sitemap’ and use that. I haven’t tested this, but here we go:

    
    /**
     * Template Name: My Sitemap
     */
    
    add_action( 'genesis_entry_content', 'add_taxonomy_list', 5 );
    
    function add_taxonomy_list() {
    
        $args = array(
            'format' => 'list',
            'taxonomy' => 'your-custom-taxonomy-slug',
        );
    
        wp_tag_cloud( $args);
    
    }
    


    J. Aaron Eaton – WordPress Consultant
    Website

    • This reply was modified 8 months, 1 week ago by  Aaron Eaton. Reason: Code block
    • This reply was modified 8 months, 1 week ago by  Aaron Eaton. Reason: Code block
    #75056

    lucaslem
    Participant
    Post count: 88

    Thanks Aaron,
    I had found a clunky work-around, but will give this a go and report back.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.