Results 1 to 2 of 2

Thread: Number conditional

  1. #1
    Thread Starter
    Senior Member toms's Avatar
    Join Date
    Aug 2010
    Location
    United Kingdom
    Posts
    147
    Thanks
    7
    Thanked 4 Times in 4 Posts

    Number conditional

    Hi,

    Does anyone know how to do this... Basically, if the price field equals a number then display the number format (as below),

    <?php $key="cp_price"; echo number_format(get_post_meta($post->ID, $key, true)); ?>

    ELSE

    Display text (for instance some users are type POA in the price field).

    So, I'd like numbers to be displayed with the number_format, but everything else as is.

    Any ideas?

    Thanks
    Tom

  2. #2
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,229
    Thanks
    89
    Thanked 593 Times in 491 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    arthemes.org - AppThemes plugins, tutorials, modifications and services

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Meta Tag Conditional
    By toms in forum ClassiPress General Discussion
    Replies: 4
    Last Post: April 28th, 2012, 08:07 AM
  2. Category Conditional
    By toms in forum ClassiPress General Discussion
    Replies: 3
    Last Post: April 26th, 2012, 04:08 AM
  3. Forms: Conditional Logic?
    By joshwhite in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: April 23rd, 2012, 08:23 AM
  4. Conditional Statement for Getting the ad_cat
    By pauln in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: January 17th, 2011, 07:42 AM
  5. Conditional display image ?
    By Caryl in forum ClassiPress General Discussion
    Replies: 3
    Last Post: April 9th, 2010, 07:15 AM