Referencing an answer to a previous question, you can break out of PHP during an IF statement using the following syntax:
<?php if (get_field ('member_only_content')): ?>
<span>Put HTML here</span>
<?php else: ?>
<span>Put HTML here</span>
<?php endif;?>
What if I only wanted to break out of php and use HTML in the first part of this statement?
<?php if (get_field ('member_only_content')): ?>
<span>Put HTML here</span>
<?php else: ?>
<?php //more php code here ?>
<?php endif;?>
Is this the only way to achieve it (multiple php tags), or is there another (perhaps tidier) way?
echofor a single line of html output. // Which, it seems, the referenced answer already showcased. So, what's the question really?<?php else { echo "Hello world"; } ?>or with your syntax,<?php else: echo "Hello world"; endif; ?>- no need to break out of PHP for every line, that would just be a mess :p