Tag to image
-
I’m trying to implement the code here to pull an image from a tag. Taken from codex here
There seems to be a parse error on line 21, the last curly brace before the closing php. Can someone see what it wrong in the code here?<?php if ($all_the_tags); $all_the_tags = get_the_tags(); foreach($all_the_tags as $this_tag) { if ($this_tag->name == "sometag" ) { ?> <p>SOME HTML CODE <img src="someimage.jpg"></p> <?php } else if ($this_tag->name == "someothertag" ) { ?> <p>SOME OTHER HTML CODE <img src="someotherimage.jpg"></p> <?php } else { // it's neither, do nothing ?> <!-- not tagged as one or the other --> <? } } } ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Tag to image’ is closed to new replies.