Get Specific Ad Image & Display It
-
I am using Advanced Ads Plugin on my WordPress website which is working fine and I am getting pixel-perfect behavior of the plugin.
As per my client requirements, I have to show the attached image (the one that I have added while saving the ad) on a custom template page. For all the saved ads, I have only used Rich Content and Image Ad types only.
Here is the current code where I want to use the image as well.
// Query the posts: $obituary_query = new WP_Query($args); // Loop through the obituaries: while ($obituary_query->have_posts()) : $obituary_query->the_post(); ?> <?php $moreLink = '<a href="' . get_the_permalink() . '"> Read More...</a>'; echo '<div class="advert-div" style="padding-bottom: 50px;">'; ?> <h2 class="ad-title"><?php the_title(); ?></h2> //Here I want to code for getting the ad image, like this //<a href="<?php the_permalink(); ?>" alt="Test Thumbnail"> // <img src="<?php the_post_thumbnail($post->ID); ?>" /> //</a> <?php echo wp_trim_words(do_shortcode("[the_ad id=".$post->ID."]"), 55, $moreLink); echo '</div>'; echo '<hr>'; endwhile; wp_reset_postdata(); ?>
I have tried different methods with no luck because I can’t figure out the actual method that is used for getting ad images.
- This topic was modified 5 years, 10 months ago by .
- This topic was modified 5 years, 10 months ago by .
The page I need help with: [log in to see the link]
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Get Specific Ad Image & Display It’ is closed to new replies.