• Resolved freizeitmonster

    (@freizeitmonster)


    Hello Greg,

    in my add ad form i have created a dropdown field to allow users to select if the price is negotiable or not (and when its not filled by user than leave it blank).

    This informatione i want to display in the list-item.php next to the price.

    <?php $price = get_post_meta( get_the_ID(), "adverts_price", true ) ?>
            <?php if( $price ): ?>
            <div class="advert-price"><?php echo esc_html( adverts_get_the_price( get_the_ID(), $price ) ) ?></div>
            <?php elseif( adverts_config( 'empty_price' ) ): ?>
            <div class="advert-price adverts-price-empty"><?php echo esc_html( adverts_empty_price( get_the_ID() ) ) ?></div>
            <?php endif; ?>

    But I did not find the right shortcode to insert the new custom field.
    Can you please give a little tutorial, how to insert custom fields into the list item?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    if you would like to display some custom field next to the price in the [adverts_list] then you can do that with the code below

    
    <?php echo esc_html( get_post_meta( get_the_ID(), "field_name", true ) ) ?> 
    

    where “field_name” is an actual name of the custom field in your [adverts_add] form.

    Thread Starter freizeitmonster

    (@freizeitmonster)

    Excellent!!!!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom field with price informations’ is closed to new replies.