Archived topic
Web Story Archive Cover and Story are Splinted
11 replies · Started by Vishvendra on October 19, 2022
This is my web story archive page. The stories appear in list view, plus their cover and stories showing separately.
The blog layout is set 2, but why is this?
Need a little help.
Additionally, I want to display Web Stories in 3 columns (only web story archive.) I've tried the solutions mentioned in the support, but they seem to not work.
Thank you very much.
Hi Vishvendra,
To clarify, are you referring to the columns on this archive page? By default, the columns setting in the Blog settings in the customizer doesn't apply to Custom Post types. You'll need to add a PHP snippet to make it work. Reference: https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-columns-to-your-custom-post-type
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
You'll need something like this:
add_filter( 'generate_blog_columns', function( $columns ) {
if ( 'CPT_SLUG' === get_post_type() && ! is_singular() ) {
return true;
}
return $columns;
} );
add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
function tu_search_column_count( $count ) {
if ( is_post_type_archive( 'CPT_SLUG' ) ) {
return 33;
}
return $count;
}
Replace CPT_SLUG with your CPT slug.
Added but still not working. The cover and story appear separate. Though, thanks for the columns.
https://drive.google.com/file/d/1dWWjkFYlB5xjZkVTWxFqg3E-YBsuLydo/view?usp=sharing
I see. How should it look like? Can you provide a sketch?
I think web stories on Google for Creators are the perfect example. They don't autoplay and have a cover that is not separated. See here.
And this is the screenshot. https://drive.google.com/file/d/15K7VBrgqFqQPk0e0E6bhrQl7vaOxOLKI/view?usp=sharing
Hi there,
do you want to remove the "Cover" image ?
As a note - the Stories are auto playing on my desktop.
I guess that would improve the UX. I could do that using display: none;
But do you have something better?
You can use a Layout Element:
https://docs.generatepress.com/article/layout-element-overview/
To disable the Featured Image, just set the Display Rules to that archive
Thanks, I almost forgot about this. Let me try this, and if something comes up, I'll let you guys know. Thanks a lot. When it comes to supporting: You guys are the best - best in the entire WordPress domain.
Glad to be of help!
Hi, David. I just tried the layout option, but it's not working.
Can you try adding this PHP snippet?:
add_filter( 'option_generate_blog_settings', function( $options ) {
if ( is_post_type_archive( 'CPT_SLUG' ) ) {
$options['post_image'] = false;
}
return $options;
} );
Replace CPT_SLUG accordingly.