Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-19-2013, 04:58 PM   PM User | #1
scattered810
New to the CF scene

 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
scattered810 is an unknown quantity at this point
Angry Need a bit of help with Php and Wordpress

I'm working on a rental property site, located here: http://goo.gl/Vo3EL

I have two classes of properties, For rent, and unavailable.
If the property was For rent, the price would display $xxx/month
If the property was unavailable, the price would display $xxx

I changed this code:
Code:
<?php if(get_post_meta(get_the_ID(), 'pyre_status', true) == 'For Rent'): ?>/month<?php endif; ?>
To this:
Code:
<?php if(get_post_meta(get_the_ID(), 'pyre_status', true) == 'For Rent' || get_post_meta(get_the_ID(), 'pyre_status', true) == 'Unavailable'): ?><?php _e('/month'); ?><?php endif; ?>
And it works just fine, now, all of the listings, regardless of "For rent" or "Unavailable" will show $xxx/month.

I have a map that displays markers for these locations with info boxes that contain the pricing. I've found this code:
Code:
<?php if(get_post_meta(get_the_ID(), "pyre_status", true) == "For Rent"): ?>/month<?php endif; ?><?php endif; ?>
Notice double quotes? This is part of a larger string that shows the information in the info boxes on the map.
I've tried changing this in numerous ways. The way I though would work, is this:
Code:
<?php if(get_post_meta(get_the_ID(), "pyre_status", true) == "For Rent" || get_post_meta(get_the_ID(), "pyre_status", true) == "Unavailable"): ?><?php _e("/month"); ?><?php endif; ?><?php endif; ?>
Does not work...
Have any advice?
scattered810 is offline   Reply With Quote
Reply

Bookmarks

Tags
php, wordpress

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:28 AM.


Advertisement
Log in to turn off these ads.