Site logo

[Resolved] How to use the content template for a query loop

Home Forums Support [Resolved] How to use the content template for a query loop

Home Forums Support How to use the content template for a query loop

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2600008
    Jack

    I watched the videos on how to create a content template and it seemed to be so easy, except here. 😉

    I wanted to add a GP Query loop on a homepage, showing the latest 6 posts. Two categories so I wanted to create two content templates for them, but I have difficulty finding the right settings to get these content templates to apply on that query loop. Whatever I do, it just won’t show on the homepage.

    #2600186
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the page in question?

    You can use the private information field:
    https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    Let me know 🙂

    #2600461
    Jack

    Hi Leo,

    The website I’m working on is an new website in progress. See login info in the private field.
    The homepage shows the query loop, and the Element Content template Nieuws should apply to that loop.

    Layout needs work, but also need to know I can get this Element to work 🙂

    #2600809
    David
    Staff
    Customer Support

    Hi there,

    GP Element Content Templates are built to hook into the themes templates, not a GB Query Loop. Although it is something we are looking at. So you need to copy your pattern from the Content Template and paste that or recreate it in your Query Loop.

    If you want to keep the designs linked then a simple solution is:

    1. edit your Content Template, select the Top level container block, and from its 3 dot menu make it into a Reusable Block.
    2. in your Query Loop, start with an empty template, and add your Reusable block inside it.

    Now whichever one you edit will update both places.

    #2601241
    Jack

    Thanks David. So I guess, until GP adds this to the GB Query Loop I will have to change colors (per category) using css.

    #2601863
    David
    Staff
    Customer Support

    Ah, ok so you need multiple content templates.
    Yeah for now you will need CSS. Let us know if you need any assistance with that.

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