• Resolved moacirsantana

    (@moacirsantana)


    Hello, I’d like to check if the ad has a payment method or not, I have a free and a premium ad.

    If it’s free, ok, nothing happens. Otherwise, I want to echo a text using php.

    I already do that in single.php, using

    $post = get_post( $post->ID ); if( $post->menu_order )...

    But in the preview template the same method doesnt work, maybe it’s because the ad hasn’t been published yet.

    How could I check it in the preview page? What “if” statement should I use as to echo a simple text?

    What if there were more payment methods? How could I know if it was payment method #1, #2… ?

    NOTE: I have been using a completely different template, using yours as a base to provide me a code won’t help, an if statemnt should be ok since I’ll know what to do afterwards.

    Thank you!

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

    (@gwin)

    Hi,
    in the preview you should be able to use the following code

    
    $listing_id = get_post_meta( $post->ID, "payments_listing_type", true );
    

    The $listing_id will be an ID of the selected pricing. To get more information about the listing use the following code

    
    $listing = get_post( $listing_id );
    
Viewing 1 replies (of 1 total)
  • The topic ‘Identify featured ad in preview’ is closed to new replies.