• Resolved PeterKottas

    (@peterkottas)


    Hello All!

    First let me thank you for this amazing plugin. I found it by mistake when looking for code while implementing my own Ajax based plugin. After playing with it I just thought, yeah okay, no point in doing it myself 🙂

    I have one question though. On our page ( https://tipsforholiday.com/ ) we have a sort of a blog which works in a following way.

    There is one div container per 4 posts. These 4 posts are in it side by side in div wrappers (columns). I’ve made it with a custom query on the page but now when I want to move to ALM, I don’t have a clue how to do it. It would require (maybe) possibility to work with more then one post in one template.

    Or maybe something like GetNextPost() so that you can do.
    <div class=”container”>
    <div class=”column”>
    Work with first post
    </div>
    <php>GetNextPost();</php>
    <div class=”column”>
    Work with second post
    </div>
    </div>

    And then offset the next query by number of posts used in one template.

    Hope it makes sense and sincerely hope it’s doable 🙂

    Any help much appreciated.

    Btw, I’ve seen the masonry template in examples and while it looks similar I think what I am after is a bit different, especially because the page is fluid and we wan’t more control over it. Hence the columns wrappers.

    https://ww.wp.xz.cn/plugins/ajax-load-more/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi Peter,
    Im not really sure what you are asking but your layout is doable with ALM.

    Just add your grid item wrapper to the repeater template and set your posts_per_page to 4.

    <div data-fade="true" data-x-params="{&quot;fade&quot;:true,&quot;animation&quot;:&quot;in&quot;}" data-x-element="column" style="opacity: 1;" class="x-column x-sm x-1-4">
    // Content
    </div>

    What is this about GetNextPost()?

    Cheers,

    Thread Starter PeterKottas

    (@peterkottas)

    Oh cool, the thing I was missing was the container is created every time new page is fetched. Works as a charm no. Sorry for a stupid question. Should have spent more time playing with it. It’s actually coded surprisingly good for a wp plugin. I just assumed it won’t work.

    One idea though. Might be cool if we can get alternating template. So use one template if page%3==0, other when page%3==1. Just an idea. Might produce some cool results. In my case for example have 1/4 1/4 1/4 1/4 in first row. Then 1/2 1/4 1/4 in second. Something like tiles. Might need to adjust post per page as well for this. Just an idea.

    Anyways, thanks for you help!

    Thread Starter PeterKottas

    (@peterkottas)

    Well found one more problem now. The thing is. I need to apply css classes to the inner wrapper (the one with alm-reveal applied to it) not the outer one. You can see that with the outer container it doesn’t work. For obvious reasons.
    https://tipsforholiday.com/shorts/
    Is it possible to apply styles to this inner one?

    Plugin Author Darren Cooney

    (@dcooney)

    Hey Peter,
    Yea you can target inner divs with your css.

    The only thing I wouldn’t update is the display attribute because ALM uses this to show/hide the alm-reveal containers.

    Thread Starter PeterKottas

    (@peterkottas)

    Cool, works for me. Not as elegant, maybe you can add it in some future release but to be fair, maybe not a lot of people would use that anyways. I can imagine some of them wanting to assign some custom animation or background so it might be useful.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘More posts within template’ is closed to new replies.