Custom fields problem - can anyone help? $10 via paypal to the person who does
Hi
I created a custom field called "Amenities" which the advertiser will tick all the boxes that are applicable to them, such as pool, wifi, pool heating, games room, etc.
But the output by default would list them as this:
<li>Amenities: pool,wifi,pool heating, games room, south facing pool, bbq</li>
I want it so that each one is on its own line so:
<li>Amenities</li>
<li>pool</li>
</li>Games room</li>
Etc.
The way around this is to delete the output cp_get_ad_details and replace it with an echo for each custom field. But if they are not ticked, the field will still appear in the page which is not good. I do not know how do to an IF statement for <li class="tick"><?php echo get_post_meta($post->ID,'cp_pool',true); ?> </li>
The other issue is that doing it this way, creates a lot of custom fields which are not needed, I'd have to have a custom field for each amenity! This will make filling in the advert form very tedious for people. I want to make it as simple as possible both for advertisers and for people reading the adverts.
This is a simple thing, I can do it myself if the solution is given to me. The problem with the first way, is that if I have the original ad details showing, it shows the street, zip code, ad start date and ad end date - fields I do not want showing at the front end on the advert. So maybe doing an echo is the only way. I have tried doing an amenity field with many values and using a tick box but it only shows the last value ticked - not multimple ones. Maybe that's a problem with the echo thing I did, I am a php novice and got there from here.
I am making very slow progress with my site, I am trying to turn classipress into a vacation home rental listings site - most of the ground work is done but there are a few customisations which I can't get past at the moment. The thing with me is I can't go onto the next thing until the thing bugging me is out of the way
Thanks
Nick