Get store ID for use inside the listing template
-
Hi,
I am trying to display an image that has been saved as custom store meta but am battling to retrieve the image url (the image store meta is the image attachment ID) as I can’t seem to access the stores ID inside this template.For example
$promoimage_id = get_post_meta( $store_id, 'wpsl_promotion_image', true );
is returning nothing. I have also tried to echo the $store_id as a test but that also fails.
Ultimately I’d like to do somehting like this if possible to access the stores ID://Get the attachment ID saves as custom store meta $promoimage_id = get_post_meta( $store_id, 'wpsl_promotion_image', true ); $img_src = wp_get_attachment_image_src($promoimage_id); //output the image $listing_template .= '<img src="' . $img_src . '">' . "\r\n";
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get store ID for use inside the listing template’ is closed to new replies.