Creating Custom Fields for Wanted/Offering
Ok, I need some help at this
I want to achieve three things
- 1) when users post a new ad, they need to specify if their ad is "for sell" or "wanted" - I don't want to use categories for this, I want to do it with a custom field so users are forced to input the correct value;[/*:m:22osp41u]
- 2) the ad type shows in each single post[/*:m:22osp41u]
- 3) on the main index page, the ad type shows in the columns, next to price or location, so anyone can spot if an ad is wanted or for sale[/*:m:22osp41u]
I created a new custom field
Code:
<select id="type">
<option classs="" value="for sale"><?php _e('I want to sell something', 'cp') ?></option>
<option class="" value="wanted"><?php _e('I am looking for somethingt', 'cp') ?></option>
</select>
for this task I followed instructions found at
http://www.erichamby.com/2009/12/16/cla ... nt-page-1/ and it works
however I still have to solve my point 2) and 3)
if I add this line in single.php:
Code:
<?php _e('Type'); ?>: <?php echo get_post_meta($post->ID, "type", true); ?>
in the single post view it only shows a text "Type:" of course... I want to be able to add the text "For sale" or "Wanted" -
how do I specify this?
then, in the main index page, how do I show the same string of text ("for sale" or "Wanted") in a column?
thank you & happy new year