<?php
if(get_field('member_only_content')){
echo "do something";
}else{
echo "do something else";
}
?>
How do I insert HTML code where it says "do something"? When removing echo "do something"; and pasting the HTML code the WordPress site crashes.
That would be because you placed the HTML code within php tags (
<?php ?>). Text inside this tag is interpreted as a PHP instruction, thus it won’t render HTML. There are 2 general ways render the HTML in a PHP file:Echo the HTML
Place the HTML Outside PHP Tags