• Resolved rafax

    (@rafax)


    Hello, how can I access the url of the image of the advert and then use it.
    To better understand what I want I do the same but with blog posts , I use the image for the banner.

    $thumb_url = get_the_post_thumbnail_url( $thumb_size );
    $thumb_style = is_single() && has_post_thumbnail() ? 'style="background: url('.$thumb_url .') no-repeat scroll center center / cover"':'';
    <div <?php echo $thumb_style;?> class="banner theme-banner-breadcrumb">

    How could I do this in the ads?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi @rafax

    Thank you for the query.

    You can use the following code –

    $listing_image_id = get_post_meta( get_the_ID(), '_listing_prv_img', true );
    $listing_image_src = atbdp_get_image_source( $listing_image_id, 'large' );

    This must help you retrieve the URL of the listing image.

    Kind Regards

    Thread Starter rafax

    (@rafax)

    Thanks @mahfuz87, that’s what I needed, but I have another question. How can I know if the post is an advertisement or a normal WordPress post?
    For example… is_single() tells me that I am in a post but not if it is an advertisement or a blog post.

    • This reply was modified 1 year ago by rafax.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Access the url of the image of the advert’ is closed to new replies.