• Resolved dallasmoore

    (@dallasmoore)


    How can I attach a new anchor to each post within the Loop? The first post would be have an anchor of – #IMG1, the second – #IMG2, the third – #IMG3, and so on. I would then need to populate an unordered list calling these same anchors, I’m guessing by rewinding the loop and starting over, this time calling each consecutive anchor as the href for a link thumbnail. Can anyone help? At least with the first part?

Viewing 1 replies (of 1 total)
  • Thread Starter dallasmoore

    (@dallasmoore)

    I just added a variable before the loop

    <?php $i==1 ?>

    Then I called it as an incremental as the anchor name for each image inside the post.

    <a name="#<?php echo i$++ ?>"></a>

    Very simple PHP, but very effective!

Viewing 1 replies (of 1 total)

The topic ‘Attach anchor to posts within WordPress Loop’ is closed to new replies.