• cloudsteph

    (@cloudsteph)


    I’d like to display the first 2 archive items differently to the rest on the page in a separate box.

    The code below works fine for getting the different sized post boxes to display but I can’t figure out how to wrap the 2 <div class=col-10″> posts in their own separate wrapping container and likewise with the rest of the posts below it.

    [large amount of code moderated as per forum rules – please use the pastebin]

Viewing 3 replies - 1 through 3 (of 3 total)
  • stvwlf

    (@stvwlf)

    post your code to the pastebin as directed and I will take a look

    Thread Starter cloudsteph

    (@cloudsteph)

    Apologies, my bad for rushing in without reading the regs.

    Posted the code here, any help appreciated: https://wordpress.pastebin.com/yZkF3wtu

    stvwlf

    (@stvwlf)

    I would have made two loops. However it can work the way you are doing it with the code I indicated below. I may not have this exactly right but I think you will follow what I am doing. The one part that needs explanation is the closing div on the col-5 wrap. You only want to print that if there is at least one post in the second box so I am testing that count is at least equal to 3 before printing the closing div.

    I also added my code to the bottom of your pastebin URL in case a moderator feels my reply contains too much code.

    [Code moderated as per the Forum Rules.]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display first 2 archive posts in separate box followed by remainders as normal’ is closed to new replies.