• Resolved lkhedlund

    (@lkhedlund)


    I’ve copied out this code from the manual, but for whatever reason it refuses to display properly:

    [loop type=post]
      [if every=5 first=true]<div class="group-container">[/if]
      [field thumbnail]
      [field title]
      [if every=4 last=true]</div>[/if]
    [/loop]

    It seems to work if I remove first=true, but then that defeats the purpose. I’ve tested it by replacing the div class with an <h4>START</h4> and <h4>END</h4>. Here is my testing code:

    [loop type=post]
      [if every=5 first=true]<h4>START</h4>[/if]
      <p>title: [field title]</p>
      [if every=4 last=true]<h4>END</h4>[/if]
    [/loop]

    And the result:

    START
    
    title: Gallery post format
    
    title: Style guide
    
    title: Another standard post
    
    title: We understand our customers
    
    title: Property law
    
    title: On your behalf throughout the process
    
    title: Post split into multiple pages, post parts
    
    END

    https://wordpress.org/plugins/custom-content-shortcode/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hi, thank you for describing the issue, and sorry for the late response.

    You’re right, using every and first/last was not working correctly. I fixed this in the latest plugin update.

    Thread Starter lkhedlund

    (@lkhedlund)

    Thanks! I ended up with a good work around, but I’m glad it’s patched up.

    Your plugin is amazing by the way. Great job!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[if every] grouping not working’ is closed to new replies.