• Resolved gervik88

    (@gervik88)


    Hey everybody,

    I’m trying to figure out, if it is possible to load every n posts one custom post type. I’m using the materializecss framework and the posts are shown in a 3 column grid layout. The plugin runs like a charm for that case, but I would like to display one custom post type in a full width layout (12 columns) after every 6 posts (2 rows) . Has anybody an idea how to setup such a shortcode?

    Kind regards,
    Viktor

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

    (@dcooney)

    Hi @gervik88,
    I think I understand that you want to display a custom layout every 6 posts?

    If so, you could use ALM Variables to to do this.

    In your repeater template.

    if($alm_current == 7){ // 7th posts displayed as featured.
    // featured layout
    } else {
    // standard layout
    }

    Does that help at all?

    Thread Starter gervik88

    (@gervik88)

    Hi @dcooney,

    thank for the quick reply! I’m trying to load six regular posts and then one custom post type. So, it’s not just changing the layout but loading a different post type and a different layout.

    Plugin Author Darren Cooney

    (@dcooney)

    Ahh, ok.

    The only way to do this would be to build a custom query and then pass post ids to Ajax Load More using the post__In parameter.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Load custom post type after every n posts’ is closed to new replies.