Tags with no Links, Simple If / Else statment?
-
Hello,
I wish to use the tag system in wordpress for keywords for another element on my site.
I plan on using the tags in php, so I need them to be “blank” ie, just the plain text.
I managed to get the tags to show in plan text, by using the following code.
<?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ' '; } } ?>
Would someone be able to tell me how to write the following..
If tags exists…. show tags….. else, show post title
I know it’s simple, but I can’t get the else part to work.
Any help would be greatly appreciated.
Cheers,
Matt
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Tags with no Links, Simple If / Else statment?’ is closed to new replies.