[Resolved] Different layout for home and blog archive page

Home Forums Support [Resolved] Different layout for home and blog archive page

Home Forums Support Different layout for home and blog archive page

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #899117
    Hasan

    Hi,

    I want to show my posts on the home page on 3-4 column masonry layout as it is currently showing (on 2 column). Also I want to show a blog archive page with just single column and full post view.

    I am currently using the default 1100px layout. My single post and blog archive content width needs to be exactly 700px, the rest could be assigned to the right sidebar.

    For the home page, I want to use a wider layout, so I can show the posts on 3 or 4 column masonry layout.

    How can I do that? Thanks!

    Regards,
    Hasan

    #899183
    Leo
    Staff
    Customer Support

    Hi there,

    Not quite sure if I understand.

    The home page is the blog page which you can modify with the settings in the customizer:
    https://docs.generatepress.com/article/using-columns-in-the-blog/

    If you want to use different layouts on other pages, check out the filters/examples at the bottom of the linked above.

    To set different widths, this should help:
    https://docs.generatepress.com/article/layout-element-overview/#content-1

    #901175
    Hasan

    Hi Leo,

    First thing I need is showing the blog archive on a separate page in addition of the homepage with different layout. Can you please tell me how to do that? Seems like can’t find any option for that. Is there any short code to do that?

    Best regards,
    Hasan

    #901310
    David
    Staff
    Customer Support

    Hi there,

    the simplest way to add an ‘archive’ grid to a static page is to use a plugin like this:

    https://wpshowposts.com

    Its another of Tom’s plugins – the free version will do what you require.

    #901626
    Hasan

    Thanks David!

    I tried the plug-in, but it is not producing the same layout as the one page archive page that GP will produce.

    Since GP has the ability to output a single column archive, is there any other way to do this without using the plug-in?

    Here is the page that I generated with the plug-in, which is not the same as the single column archive that GP produces: https://snapbangladesh.com/stories/

    Any idea? Thanks!

    #901634
    Leo
    Staff
    Customer Support

    You’d need a custom solution without a plugin unfortunately.

    You can definitely create one column using Show Posts though.

    Where can I see the show posts list currently?

    #902119
    Hasan

    Here is the list made with Show Posts: https://snapbangladesh.com/stories/

    #902363
    David
    Staff
    Customer Support

    So how do you want the WP Show Posts list to display? Like the 4 column grid you have on your Home Page?

    #903281
    Hasan

    I want the archive layout to be the same as the single page here except the comment section, coming one after another in a separate card for each post: https://snapbangladesh.com/barisal-ferry-3/

    I was able to twik the show posts setting further and make it almost similar, except the posts are joined together, while I want them to appear on separate cards.

    How can I do that?

    Thanks!

    #903425
    David
    Staff
    Customer Support

    Tricky one – this CSS should work specifically for that page:

    .page-id-33.separate-containers .inside-article {
        padding: 0;
        background-color: transparent;
    }
    .page-id-33 .wp-show-posts-inner {
        padding: 40px;
    }
    .page-id-33 .wp-show-posts-single {
        background-color: #fff;
    }
    #903438
    Hasan

    That worked, thanks!

    How can I reduce the gap between two posts about 20 px?

    #903443
    David
    Staff
    Customer Support

    This CSS:

    .wp-show-posts:not(.wp-show-posts-columns) .wp-show-posts-single:not(:last-child) {
        margin-bottom: 20px;
    }
    #903449
    Hasan

    Awesome! That makes the page as I wanted.

    Thank you so much!

    #903470
    David
    Staff
    Customer Support

    You’re welcome

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.