Tab shortcode with custom fields
-
I’ve got a template file which uses custom field and i want to use shortcodes in the file as well.
The shortcode makes the content appear in tabs on the page.
I’ve had a go but i’m not a php developer. It comes up with an error saying Unexpected T_STRING. The error comes on the first do_shortcode line.
Here’s the code:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php do_shortcode("[tab name='Overview']<div id="product-image"><?php the_post_thumbnail(); ?></div> <?php the_field('overview'); ?>[/tab]"); do_shortcode("[tab name='Features & Benefits']<?php the_field('features_&_benefits'); ?>[/tab];"); do_shortcode("[tab name='Options & Accessories']<?php the_field('options_&_accessories'); ?>[/tab];"); do_shortcode("[tab name='Downloads']<a href="<?php the_field('downloads'); ?>">Download PDF</a>[/tab];"); do_shortcode("[tab name='Supplies']<?php the_field('supplies'); ?>[/tab];"); echo do_shortcode("[end_tabset]");?>
Anybody know how to get this to work?
Thanks
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘Tab shortcode with custom fields’ is closed to new replies.