putting the shortcode into my template
-
Hi there,
I’ve tried a few different ways and I’m close, but my syntax, I think, is throwing things off. Can someone help me get my code right?I put together a FAQ page using Advanced Custom Fields. That bit is working great. Now I want to add in C-o-M so the user can click the titles and show the answers.
I had this:
[expand title="<?php the_sub_field('question_title') ?>"] <p><?php the_sub_field('question_answer') ?></p>[/expand]')
and it showed the question titles and answers, but also the brackets and “expand” code, so I realized I needed to call the shortcode first and did this:
<?php echo do_shortcode('[expand title="<?php the_sub_field('question_title') ?>"] <p><?php the_sub_field('question_answer') ?></p>[/expand]') ?>
And the page is showing the error
Parse error: syntax error, unexpected T_STRING
Any suggestions on how to fix?
Thank you!https://www.ads-software.com/plugins/jquery-collapse-o-matic/
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘putting the shortcode into my template’ is closed to new replies.