What’s the resulting url for your attempt with the external version?
I believe the meta key for the url is _etsy_product_url based on checking the code quick.
Thanks for getting back to me, Michael. For the time being, I’ve hacked the plugin to suit my needs. The do_shortcode with external attribute does actually work, but not in the way I want it to. I can get a single product’s external link to show up, with the following:
echo do_shortcode( '[product_link id=1 external=true]' );
But ideally I want it to change all links to point externally. Ideally – to change the permalink url on my products page. Is there any way to incorporate the shortcode within these template tags (using a Twenty Fifteen child template of ‘contents.php’)?
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
I’ve tried pulling in the _etsy_product_url meta key, but with no luck.
OK – I’ve managed to get the _etsy_product_url meta to work. Here’s what I use in my template files:
echo get_post_meta( get_the_ID(), '_etsy_product_url', true );
I’ll mark this topic as resolved – although it’s moved away from the original thread title somewhat 😉
This is the full chunk of code to replace the_permalink section above:
<h2><a href="<?php echo get_post_meta( get_the_ID(), '_etsy_product_url', true ); ?>"><?php the_title(); ?></a></h2>
You’d need to replace the_permalink() with an echo’ing of the exteranl link meta field.
<h2><a href="<?php echo get_post_meta( get_the_ID(), '_etsy_product_url', true ); ?>"><?php the_title(); ?></a></h2>
I didn’t refresh before I replied. We came to the same conclusion though 🙂