Forums

[resolved] Icons next to title (4 posts)

  1. nixxyc
    Member
    Posted 1 year ago #

    I'd like to place an icon next to the title of posts depending on whether they are images, video or text. For example, a camera icon next to the title of a post that's an image, a pencil next to the title of the post that's just text. Can someone please let me know if there is a away to do this? Thanks!

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    I'd like to place an icon next to the title of posts depending on whether they are images, video or text

    how does the post know what it is?

    example:
    if you use categories for this, you might be able to use post_class() on the title or the post div; and generate the icons with background images.
    http://codex.wordpress.org/Function_Reference/post_class

    a post with the category 'video' will get the css class .category-video (and other css classes)

    in style.css, you could use for instance:

    .post.category-video h2 { background: url(images/video-icon.png) left top no-repeat; padding-left: 20px; }

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    could just wait for WP 3.1 with post formats and use an appropriate bg image in css per post format

  4. nixxyc
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags