I am currently using the following code within single.php (after the_content) This gets the store_name from custom field as $merchant from the post and then returns a list of products from that merchant from and external script.
<?php $merchant = get_field('store_name'); echo '<h3> Random products from ' . get_field('store_name') . '</h3>'; $external_baseHREF = "http://www.website.com/store/"; $external_path = "/home/website/public_html/store/"; $_GET["q"] = "merchant:".$merchant; require($external_path."searchExternal.php"); ?>
This is working fine, however I cannot move the position of where the products are appearing, they currently appear after the main post.
I would like to have them appearing further up the post, and one solution I have considered is adding them via a shortcode so I can position them as I like eg [merchant-name merchantname="Adidas"] or something similar
Can you please assist in creating this shortcode? Or offering alternative solution.