WordPress.org

Ready to get started?Download WordPress

Forums

Post icon according to category (1 post)

  1. diasje
    Member
    Posted 4 years ago #

    Hello, i have a Vlog website, that have normal Text posts.
    In the front page, i have an excerpt of every post.
    I would like to know if it is possible to have a icon (png image) indicator of wat kind of post it is.

    Like:

    <?php if ( is_category('4') ): ?>
    <img src="http://mywebsite.com/images/vid.png" alt="Video Post" />
    <?php if ( is_category('5') ): ?>
    <img src="http://mywebsite.com/images/text.png" alt="Text Post" />
    <?php else: ?>
    <?php endif; ?>

    I have tested this but only get T_endwhile error.

Topic Closed

This topic has been closed to new replies.

About this Topic