Shortcode in template

WordPress Released
March 16, 2020 14:08:17
Topics: 4
Messages: 12
Hi!

What a great plugin you guys have! I am using it to get custom post types printed on labels. Each label has a barcode. I'm looking for a way to get the barcode (which is created with a shortcode: [barcode text='12345' type=code128]) within the template.
Could you guys help me out a little.

I have basic knowledge of php en wordpress backend if needed.
March 16, 2020 14:49:43
E2Pdf
Topics: 7
Messages: 3614
Support
Hi, thank you.

Can you please clarify some information:

1. Does your meta values contains just text (12345) from which you need to generate barcode?
2. Do you have this shortcode inserted inside page body?
3. Which plugin are you using to generate barcodes?

We remain at your service.

We would really appreciate your feedback at WordPress.org!
March 16, 2020 15:21:53
Topics: 4
Messages: 12
Hi and thank you for the quick reply.

1. No 12345 is a placeholder for now. 12345 should be replaced with the title of the current post.
like this: [barcode text='<?php get_the_title();?>' type=code128]. But first things first, a 12345 would be a small victory.

2. I have the shortcode displayed on the post as well. This however is not per se necessary

3. The plugin: https://nl.wordpress.org/plugins/barcode-qrcode-generator/
March 17, 2020 11:40:17
E2Pdf
Topics: 7
Messages: 3614
Support
Hi,

To accomplish this task please update plugin to latest version (1.10.07). After this follow instruction below:

1. Create E2Pdf Image object inside template with [post_title] as "value" if you need to generate barcode from title. (Screenshot 1)

2. Copy and add filter to your theme functions.php https://codeshare.io/5DyDRp. Modify the values of Template ID (46) and Element ID (2) according to your values. (Screenshot 2 attached with information where you can find Template ID and Element ID).

After this steps barcode must be generated from the title. Let us know please if there will be any issues. Thank you.

P.S. [barcode text='12345' type=code128] will also work properly if set as "value" inside Image Object.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
March 17, 2020 12:57:00
Topics: 4
Messages: 12
Awesome!
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.