- This topic has 9 replies, 4 voices, and was last updated 4 years, 4 months ago by
Ying.
-
AuthorPosts
-
October 6, 2021 at 1:33 am #1954309
Len
How is a multiple column layout created for a custom taxonomy or custom post type archive with the Elements Content Block.
I cannot find any help for this. If a layout is created at 50% width, how will that repeat horizontally?
I have done a single column layout which works fine assigned to my CPT archives etc.
Thanks, LenW
October 6, 2021 at 4:47 am #1954493David
StaffCustomer SupportHi there,
the Block Element Content Template only replaces the content template in the post loop.
Today you still need to define the Column requirements in the Customizer > Layout > Blog.However by default the columns options only work with standard post types.
To enable columns on a CPT you would need a little PHP:add_filter( 'generate_blog_columns', function( $columns ) { if ( 'your_cpt_slug' === get_post_type() && ! is_singular() ) { return true; } return $columns; } );We’re working on new archive grid options for a future update.
October 11, 2021 at 2:52 pm #1960374Len
David
Thanks, this works – as long as the following is done:
The content template is set to full width as a design for the block, this code then reduces the width to that of the column.
If I start off with a 50% block in the content template editor, I end up with a 25% column if columns set to 2.So template design a little tricky.
LenW
October 11, 2021 at 4:13 pm #1960393David
StaffCustomer SupportYou can set the elements Editor Width in the sidebar settings – see here, in the example i have set it to 320px wide:
https://www.screencast.com/t/pKagnV1BS
This will allow you to create your design at a size that is representative of the front end display.
October 12, 2021 at 1:33 pm #1961451Len
David, thanks for that suggestion, its a good help.
LenWOctober 12, 2021 at 3:54 pm #1961522David
StaffCustomer SupportGlad yo be of help!
November 21, 2021 at 4:26 pm #2013825Dan
Hi David,
is there an update regarding this:We’re working on new archive grid options for a future update.
or should we still stick to the filter
add_filter( 'generate_blog_columns', function( $columns ) { if ( 'your_cpt_slug' === get_post_type() && ! is_singular() ) { return true; } return $columns; } );Thanks
DanNovember 21, 2021 at 4:30 pm #2013832Ying
StaffCustomer SupportHi Dan,
Currently this is still the one to use 🙂
November 21, 2021 at 4:34 pm #2013836Dan
Thanks Ying for the quick answer.
Dan
November 21, 2021 at 4:38 pm #2013840Ying
StaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.