0

Forgive me, my PHP skills are rough to say the least, I am trying to pass PHP into PHP see below

<?php echo do_shortcode('[tab name="Info"]
<span>Address:<?php echo get_field('address'); ?></span>
[/tab][end_tabset]'); ?>

I don't know what I am doing wrong and I have been searching everywhere, but nothing seems to work.

I appreciate any help.

0

1 Answer 1

7
<?php

echo do_shortcode('[tab name="Info"]
<span>Address:' . get_field('address') . '</span>
[/tab][end_tabset]');
Sign up to request clarification or add additional context in comments.

1 Comment

To clarify, do_shortcode does not interpret PHP code in the string. It only interprets WordPress short codes such as [tab]. Also, you were closing the string with the single quotes around address in the call to get_field, but that is solved by extracting the PHP function call outside of the string.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.