Site logo

Archived topic

Web Stories edit

11 replies · Started by Oscar on January 4, 2021

Viewing posts 1–12 of 12

Hi, i am using Web Stories plugin
I was looking at the forum and I see that usually the plugin generates a page to display the stories, however, in my case created in an archive page. This to some extent limits me to be able to add or remove elements.
The stories are show in archive page https://dietadelhuevo.com/web-stories/
I have tried with CSS to show the stories one by one in columns of 3, however I cannot do it.
Could you help me by indicating which are the classes that I should modify in order to put the stories in 3 columns?

Thanks a lot!

Hi there,

you can try adding this PHP Snippet to your site so that archive uses the Blog Columns ( which you can set in Customizer > Layout > Blog ):

add_filter( 'generate_blog_columns', function( $columns ) {
    if ( ! is_singular() && 'web-story' === get_post_type() && ! is_post_type_archive( 'web-story' ) ) {
        $columns = true;
    }

    return $columns;
} );

How to add PHP: https://docs.generatepress.com/article/adding-php/

Hello David, thanks for you response.

I added the snippet to my child theme, however I can't show the stories in columns. In small screens I have no problem showing in one column. In the desktop version is where I need to display in 3 columns.

I try to do this in Customizer > Layout > Blog > Archives > Columns

Can you try adding this as well?

add_filter( 'generate_blog_get_column_count', function( $column_width ) {
    if ( ! is_singular() && 'web-story' === get_post_type() && ! is_post_type_archive( 'web-story' ) ) {
        return '33';
    }

    return $column_width;
} );

Hi Leo, there are no change even adding the code you give me.
Are you taking into account that this is not a page, nor an entry but an archive?

The screenshots I sent are still the same scenario I have in the customizer control panel.

Try removing this last condition from both snippets provided:

&& ! is_post_type_archive( 'web-story' )

Yeah!!! Now is work perfectly!

Thanks a lot David and Leo! You are the best!

Have a nice day.

Thanks for yoy support.

Glad we could be of help.

where to paste this code please tell a little detail i don't know much

This archived topic is closed to new replies.