Hi Jim,
Thanks for the reply!
Actually, I have already created a Pod Template and selected ‘After’.
Here is a screenshot of the Pod Template:
https://www.screencast.com/t/K1hrRREp
Here is a screenshot of the product on the front-end:
https://www.screencast.com/t/dvaXxQZEIWv
You can see I indicated where I want to insert image download links in the WooCommerce product-image.php template, below the actual image.
Here are the two fields in my Pod:
https://www.screencast.com/t/dHtvkqMraEc
1. Product Label
2. Scientific Support
These two are PDF uploads for which I want to display a image download button each, on condition that a file is uploaded:
<a href="/value_of_pod_field.pdf"><img src ="/image.jpg"></a>
If a file has not been uploaded for either field, then don’t display that button.
I am dangerous when it comes to PHP ??
Found some code snippets here and there, and tried but nothing worked.
<?php if(!empty(($scientificsupport = get_post_meta($post->ID, 'scientific_support', true)))) {?>
Scientific Support: <?php echo preg_replace('|https?://|', '', $scientificsupport ); ?>
<?php $site = preg_replace('{/$}', '', $scientificsupport);} ?>
<?php $label = get_post_meta( get_the_ID(), 'product_label', true ); ?>
<a href="<?php echo $label; ?>">Linked Label Button Here</a>
<?php $science = pods('scientific_support', $id); ?>
<a href="<?php echo $science->field( 'scientific_support' ); ?>">Linked Science Button Here</a>
<?php $science = get_post_meta($post->ID, 'scientific_support', true);
if($science != '') {
echo $science;
} ?>
Am a bit confused…
So I’m hoping you can help me with the right code, please?
Thanks in advance!