[Resolved] Replicate GP Archives/Blog with SiteOrigin Loop on a PageBuilder page

Home Forums Support [Resolved] Replicate GP Archives/Blog with SiteOrigin Loop on a PageBuilder page

Home Forums Support Replicate GP Archives/Blog with SiteOrigin Loop on a PageBuilder page

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1387296
    Stonebriar Webmaster

    Thanks for the wonderful theme and premium plugin. I’m using a child theme of GeneratePress with SiteOrigin’s Widget Bundle and PageBuilder.

    I’m trying to get use SiteOrigin’s Post Loop widget to replicate what the GP Premium archives already look like on my Blog page. Specifically, I can’t find a way to display each post’s entry-meta section (date and author) after the posts’ title inside the SiteOrigin Post Loop on my PageBuilder page.

    Interestingly, the footer entry-meta does display for each post, which I also need. ๐Ÿ™‚

    I’ve tried adding code to my child theme’s functions.php page, but I need some help with an example to try.

    Thanks in advance!

    #1387302
    Leo
    Staff
    Customer Support

    Hi there,

    Not sure if I fully understand but this sounds like something you will need to check with Site Origin’s support?

    Let me know if I’m missing something here.

    #1387334
    Stonebriar Webmaster

    I am using the GP content.php file as my SiteOrigin Loop template. Everything else seems to work except for some of the post meta data not coming in. I initially thought it was because those items get turned on by GP Premium under Layout > Blog in the WP Customizer; and that perhaps I needed to hook into a GP Premium function somehow to make them display inside the SiteOrigin Post Loop.

    I like the clean efficiency of the GP Theme code, so I wanted to work within that model if possible before trying to put something inferior together.

    Can we please look at this again with this extra info?

    #1387441
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    A lot of the post meta will only display if it’s the post post type:
    https://docs.generatepress.com/article/generate_entry_meta_post_types/
    https://docs.generatepress.com/article/generate-footer-meta-post-types/

    Perhaps that’s the issue?

    #1387532
    Stonebriar Webmaster

    Tom, I think I may have resolved my issue, but I have a question about how the GP Header Element uses Template Tags.

    My issue was that in the GP Header Element that I was using as my Global Header was using {{post_date}}, {{post_author}}, and {{post_terms.taxonomy}} Template Tags. And, on the SiteOrigin Page, these pieces of data would not render in the Post Loop. Sadly I had forgotten that I previously saw this same behavior on the main Blog and Archives. My earlier “solution” for the Blog and Archives was to create a special Header element that did not use those Template Tags, only using {{title}} Template Tag.

    My question is if there is another way to use Template Tags like {{post_date}} in a Header element and still have post dates display for each entry inside the loop on Blog/Archive pages. Maybe there is a hook (e.g.: “generate_after_entry_title”) to “reset” the fact that I already “used up” those variables in the Header element?

    If the best solution is to duplicate Header elements, I’ll do that, but I wanted to ask if there was a better way.

    Thank you for the help so far,
    Bill

    #1388413
    Tom
    Lead Developer
    Lead Developer

    So when you used those template tags, those elements were removed from the posts in the loop?

    #1388544
    Stonebriar Webmaster

    Tom:

    That is correct. If I use a template tag (e.g.: {{post_date}}) in the Header element that is displaying on the Blog or Archives page, then the post’s date is removed from each of the posts listed in the loop on that WP “page”.

    Thanks,
    Bill

    #1388673
    Tom
    Lead Developer
    Lead Developer

    {{post_date}} is meant to get the date from the current post, which is why it’s conflicting on archive pages. What date are you trying to display there? The date from the latest post?

    #1389734
    Stonebriar Webmaster

    Tom:

    I am using the same header element on the entire site. The {{post_date}} in the global header was meant for a page’s date, and on a Blog/Archive page there is no {{post_date}} and the template tag renders as “{{post_date}}”, which I had hidden using CSS. I’m okay with no post date showing in the Header Element when it is on an Archive page. This conflict however omits each post’s date information from the entry-meta of each post listed. However, I was trying to display each post’s date in the list.

    It seems like my 2 options are:

    1) to create multiple Header elements for various uses (pages vs. blog/archives/search vs. posts)
    2) to program my one “header element” functionality using a Hook element instead

    I can work around this limitation if I need to; I was wanting to make sure a work-around was the correct way to build this out if there was not something I was not knowing how to do in order to use the theme the preferred/designed way. (I prefer to work with a theme and plugin as much as possible before I create any overrides.)

    Thank you for your help so far. I think I’ll proceed with option 1 above unless you know of a way around the conflict I have in this situation.

    Thanks again!
    Bill

    #1390238
    Tom
    Lead Developer
    Lead Developer

    I would create two different Header Elements, one with the post date and one without. It would be nice if we could add conditionals in the future that you could set – it’s something we’re working on.

    #1390311
    Stonebriar Webmaster

    Thank you for your attention to this ticket and helping me think through how to best build things out.

    We are very grateful for your theme and Premium plugin.

    Thanks!
    Bill

    #1391656
    Tom
    Lead Developer
    Lead Developer

    Glad I could help! ๐Ÿ™‚

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