- This topic has 12 replies, 4 voices, and was last updated 4 years, 9 months ago by Tom.
-
AuthorPosts
-
June 26, 2019 at 4:08 am #941559David
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
DaveJune 26, 2019 at 7:03 am #941867DavidStaffCustomer SupportHi there,
when you say the layout does the Layout Element not achieve what you need?
https://docs.generatepress.com/article/layout-element-overview/
June 26, 2019 at 7:35 am #941914DavidHi David
I would like it to show in 4 columns on this page…
http://185.20.51.60/~markettownmemori/memorialcategories/cemetery-memorials/
Don’t think that is achievable via the layout element is it?
Thanks
DaveJune 26, 2019 at 7:56 am #941948DavidStaffCustomer SupportJune 26, 2019 at 8:57 am #942031DavidI’ve added this to my functions.php but 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 33;
}return $count;
}http://185.20.51.60/~markettownmemori/memorialcategories/cemetery-memorials/
June 26, 2019 at 1:18 pm #942279LeoStaffCustomer SupportThe return variable name (
$columns
and$count
) needs to match.And it should be 25 if you want 4 columns.
Let me know π
June 26, 2019 at 11:58 pm #942552DavidI 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?
June 27, 2019 at 5:32 am #942731DavidThis is working on the archive page now…
http://185.20.51.60/~markettownmemori/memorials/
But I can’t seem to work out how to do the taxonomy category pages…
http://185.20.51.60/~markettownmemori/memorialcategories/cemetery-memorials/
June 27, 2019 at 8:49 am #943040TomLead DeveloperLead DeveloperTry this:
add_filter( 'generate_blog_columns', function( $columns ) { if ( is_post_type_archive( 'memorials' ) || is_tax( 'memorialcategories' ) ) { return 25; } return $columns; } );
June 27, 2019 at 9:14 am #943061DavidThat’s great – Thanks Tom π
What’s the best way to show the columns at 50% on mobile?
Thanks
DaveJune 27, 2019 at 3:00 pm #943320TomLead DeveloperLead DeveloperGive 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; } }
June 27, 2019 at 11:41 pm #943487DavidThanks Tom π
June 28, 2019 at 12:16 pm #944142TomLead DeveloperLead DeveloperYou’re welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.