Generate QR Code for Each Listing

Share this resource

Share on facebook
Share on twitter
Share on linkedin
Share on email
Share on facebook
Submitted by: Donald McGuinn

YOU NEED ELEMENTOR PRO:

  • -Go to Elementor Templates on Dashboard
  • -Create New SAVED TEMPLATE
  • -Make it a section template (not page)
  • -Name it whatever you want
  • -Paste in a shortcode element [listing_qr]
  • -Save it and return to the template page where you see all your templates
  • -Copy the shortcode associated with that template from the right-hand side (you need Elementor Pro)
  • -Take that shortcode and paste it in a shortcode block on the single page settings of the listing type you need it to show on.

Add the code below to your functions.php file.

//LISTING QR CODE GENERATOR
//=========================
function qr_code_generator() {

	$permalink = get_permalink($post->ID);
	echo '<img src="https://api.qrserver.com/v1/create-qr-code/?size=100x100&data='.$permalink.'">';

}
add_shortcode( 'listing_qr', 'qr_code_generator' );