Forums

Change a value of a custom field? (3 posts)

  1. euforico
    Member
    Posted 1 year ago #

    Hi!

    I have a custom fiel called "hello" if the value is "1" i want show an image "01.gif", if the value is "2" show other image "02.gif"

    Someone know how can do it this?

  2. euforico
    Member
    Posted 1 year ago #

    Anyone know how to do this?

  3. omgitztrey
    Member
    Posted 1 year ago #

    You can do a IF THEN statement

    I'm not sure how to make it compare the if Hello = 1 then show image 01.gif...

    but would it be a hassle to create two custom fields? Hello1 and hello2 and just use the code below to display it?

    <?php if ( get_post_meta($post->ID, 'hello', true) ) { ?>[image url]<?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.