[Resolved] Show Taxonomy Categories on Archive instead of posts

Home Forums Support [Resolved] Show Taxonomy Categories on Archive instead of posts

Home Forums Support Show Taxonomy Categories on Archive instead of posts

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #946220
    David

    Hello

    Is there anyway of showing custom taxonomy categories on custom post archive page, instead of the posts like I have here…

    http://185.20.51.60/~markettownmemori/memorials/

    Thanks
    Dave

    #946585
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It’s possible, but you would need to create a custom template and loop the categories instead of the posts. Unfortunately it’s quite a bit job, so it’s not really something I can provide code for in here.

    #947181
    David

    Thanks Tom, I’ve got this sorted now.

    On the custom taxonomy archive page, what do I need to do to make sure images are cropped to the same size on the category page?

    http://185.20.51.60/~markettownmemori/memorialcategories/cemetery-memorials/

    I’ve added this to functions but doesn’t seem to work…

    add_filter( ‘generate_blog_image_attributes’,’tu_variable_image_sizes’ );
    function tu_variable_image_sizes( $atts ) {
    // Set up our conditional
    if ( is_post_type_archive( ‘memorialcateogories’ ) ) {
    $atts[ ‘width’ ] = 800;
    $atts[ ‘height’ ] = 600;
    $atts[ ‘crop’ ] = true;
    }

    // Return our options
    return $atts;
    }

    #947210
    Tom
    Lead Developer
    Lead Developer

    I would do this:

    add_action( 'wp', function() {
        add_image_size( 'memorial-categories', 800, 600, true );
    } );
    
    add_filter( 'generate_page_header_default_size', function( $size ) {
        if ( is_post_type_archive( 'memorialcategories' ) ) {
            return 'memorial-categories';
        }
    
        return $size;
    } );

    You may need to regenerate your thumbnails once you add this code: https://en-ca.wordpress.org/plugins/regenerate-thumbnails/

    #947666
    David

    Thanks Tom

    #948150
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.