• Resolved Chris Lowry

    (@medical-revision)


    Trying to set up columns on my front page. Code is working fine for first colum but not on second column in the loop.

    Full code here: https://pastecode.xyz/view/6d734473

    But the basic issue is here:

    <?php if ($c==5 || $c==8){ echo "<div class='frontcolumn'>";}?>

    There’s a $c++ earlier on in the loop. A front column div is being generated with the 5th post, but not the 8th one, and I can’t work it out!

    Thanks for the help,
    C

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hard to say without seeing the site in action and being able to test but it could be the earlier line causing the issue:

    <?php if ($c==7 || $c==10){ echo "</div";}?>

    The end div isn’t being closed so the subsequent <div class=’frontcolumn’> may not be displaying correctly.

    The PHP seems fine and seems to be working with regards to the values for $c and the ‘frontcolumn’ div actually being generated in code.

    Thread Starter Chris Lowry

    (@medical-revision)

    Ha, came to post this reply back in here, and @maft already beat me!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Loop ignoring variable’ is closed to new replies.