I'm having trouble defining a function in advance custom fields. Basically i need a field populated by a title(text field), a wysiwyg editor and two file upload fields on the bottom of a few product pages. But i only want to show the field+title if one of the fields is populated.
product info fields are:
product_info_title - Text field
product_info_content - wysiwyg editor
product_info_file_1 - File
product_info_file_2 - File
here is my current acf code in my custom page template:
<div class="post-content">
<?php the_content(); ?>
<?php
if( function_exists('get_field')) {
if(get_field('product_info_content')) {
echo '<div class="info-box">';
echo '<h1>' . get_field('product_info_title') . '</h1>';
the_field('product_info_content');
echo '</div>';
}
}
?>
What i can't get to function properly is to check if ANY of the three fields i have besides the title field is populated and if so display it along with the title field.