• Hello everyone,

    I’ve got an idea, but coming up short on execution. I’d like to display the post TAGS, as images rather than text. Anyone think this is possible?

    The reason I want to do this, is probably only useful in a select few situations, but for me is simple. On my portfolio site (which is only local at this point) I would like to add tags to my posts like: CSS, HTML Photoshop etc. and then have those displayed as little icons rather than just text.

    Any bright ideas out there?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Matt

    (@mkvoran)

    Bump…. anyone?

    Hi Matt,

    I did this a while back with a nice hack/workaround, not a problem.
    I assume that when your portfolio includes css, html and photoshop work you know how to edit a template.

    The function you are looking for is probably already in your template:
    <?php the_tags( $before, $separator, $after ); ?>

    create your icons inside your template_folder/images/icons/[tag_name].jpg/png/gif

    alter the the_tags $before, $separator and $after variables accordingly.

    Haven’t tested it but should be something like this:

    <?php the_tags('<ul><li><img src="'.get_bloginfo("template_url").'/images/icons/','.jpg" /></li><li><img src="'.get_bloginfo("template_url").'/images/icons/','.jpg" /></li></ul>"); ?>

    In case the_tags() already auto-formats into a list, just use the <img />- part of the above code.

    Should at least kick you right in the right direction.
    Good luck:)

    Thread Starter Matt

    (@mkvoran)

    Ah! Brilliant. Great workaround, I’ll give it a shot – I think this will work.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display post tags as images’ is closed to new replies.