Results 1 to 6 of 6

Thread: If else PHP coding extended

  1. #1
    Thread Starter
    patrickcrielaard's Avatar
    Join Date
    Apr 2013
    Location
    Netherlands
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts

    If else PHP coding extended

    As a follow-up on my previous post:
    http://forums.appthemes.com/classipr...-coding-50771/

    The solution there works perfectly but I would like to extend it to the value of a dropdown list.

    The dropdown list = cp_sale_or_rent
    sale = value 1
    rent = value 2

    So when an option is selected it shows a different answer than when a different option is selected.

    I tried the code:
    PHP Code:
    <?php if ( get_post_custom_keys $post->ID'cp_sale_or_rent''1' ))
                    { echo  
    "Yes, it is for sale"
                    else ( 
    get_post_custom_keys $post->ID'cp_sale_or_rent''2' ))
                      echo 
    "No, it is for rent"; } ?>
    But this is not working.
    I think I selected the get_post_custom_keys properly.

    Any suggestions?

    Best,
    Patrick

  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

  3. #3
    Thread Starter
    patrickcrielaard's Avatar
    Join Date
    Apr 2013
    Location
    Netherlands
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    ridabenharrou's Avatar
    Join Date
    Jun 2011
    Location
    Morocco
    Posts
    169
    Thanks
    2
    Thanked 45 Times in 32 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #5
    Thread Starter
    patrickcrielaard's Avatar
    Join Date
    Apr 2013
    Location
    Netherlands
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #6
    ridabenharrou's Avatar
    Join Date
    Jun 2011
    Location
    Morocco
    Posts
    169
    Thanks
    2
    Thanked 45 Times in 32 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Dimitris Css coding in cp3.2 - Should this be like this?
    By bleem in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: December 12th, 2012, 01:04 PM
  2. Dimitris Css coding in cp3.2 - Should this be like this?
    By bleem in forum ClassiPress General Discussion
    Replies: 3
    Last Post: December 12th, 2012, 01:04 PM
  3. Need some coding help, please.
    By dmyers in forum ClassiPress General Discussion
    Replies: 3
    Last Post: October 17th, 2010, 02:31 AM
  4. CAn anyone help with PHP coding?
    By dollarpermile.com in forum ClassiPress General Discussion
    Replies: 1
    Last Post: June 14th, 2010, 06:50 PM