[Support request] Content Template for Archive, Search Pages

Home Forums Support [Support request] Content Template for Archive, Search Pages

Home Forums Support Content Template for Archive, Search Pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2090189
    Samuel

    I know how to use the content template to control how the individual posts are displayed on an archive page, but I’d also like to create a template for the entire page. For example, I’d like to put all the search results in a container. Is there a way I can do this with an element?

    #2090196
    Ying
    Staff
    Customer Support

    Hi Samuel,

    Any example sites we can have a look to help understand what you are trying to achieve better?

    #2090293
    Samuel

    Unfortunately it’s still on my local computer. The big thing I want to do is be able to wrap the search results around a GB Container block. So for example the html on the main content area of the page would be:

    Headline Element
    Open Container Element
        Post 1
        Post 2
        Post 3
    Close Container Element

    I can use a content template to style Post 1, 2, 3 the way I want to. I’m wondering if there is a way to create a template for the entire page. In the example above that would include the Headline element and Container element that the search results appear in.

    #2090502
    David
    Staff
    Customer Support

    Hi there,

    no thats not possible using a Content Template.
    What is the purpose of this additional container ? As the Search results are already in a container if you just need to style it differently we can provide some CSS.

    #2090591
    Samuel

    What I want to do is display the posts in a two column flex container with a specific gutter, etc. I can think through an alternate approach from what I was doing. One thing I ran into is that the navigation element. When I make the div that contains the list of posts a flex container the page navigation at the bottom wants to act like the last flex element since it is in the same div. What’s the best way to solve that?

    #2090911
    David
    Staff
    Customer Support

    Simplest option is to use the Blog Columns option in the Customizer > Layout > Blog:

    https://docs.generatepress.com/article/using-columns-in-the-blog/

    If need be you can set columns for different templates:

    https://docs.generatepress.com/article/using-columns-in-the-blog/#changing-the-number-of-columns

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