Site logo

Archived topic

Custom post type page

12 replies · Started by David on June 26, 2019

Viewing posts 1–13 of 13

Hello

I've set up a custom post type called memorials. I've then set up a archive-memorials.php and singe-memorials.php.

I've made some changes to the archive page to show the list of the custom taxonomy called memorialcategories.

What page do I need to change to be able to change the layout of this page...

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

Here is the archive page...
http://185.20.51.60/~markettownmemori/memorials/

Thanks
Dave

The return variable name ($columns and $count) needs to match.

And it should be 25 if you want 4 columns.

Let me know :)

I changed it to this, but still no luck...

// COLUMNS FOR CUSTOM POST TYPE

add_filter( 'generate_blog_columns','tu_portfolio_columns' );
function tu_portfolio_columns( $columns ) {
    if ( is_post_type_archive( 'memorials' ) ) {
        return 25;
    }

    return $columns;
}

Any other ideas?

Try this:

add_filter( 'generate_blog_columns', function( $columns ) {
    if ( is_post_type_archive( 'memorials' ) || is_tax( 'memorialcategories' ) ) {
        return 25;
    }

    return $columns;
} );

That's great - Thanks Tom :)

What's the best way to show the columns at 50% on mobile?

Thanks
Dave

Give this a shot:

@media (min-width: 415px) and (max-width: 768px) {
    .generate-columns-container .grid-sizer,
    .generate-columns-container article {
        width: 50%;
    }

    .generate-columns-activated .generate-columns-container {
        margin-left: -20px;
    }

    .generate-columns-container > * {
        padding-left: 20px;
    }
}

Thanks Tom :)

You're welcome :)

This archived topic is closed to new replies.