WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Advanced Custom Fields] check if any field of field group has value

[Resolved] [Plugin: Advanced Custom Fields] check if any field of field group has value

  • i want this section (section#contact) only if any field of field group has value. my field group name ‘Contact Info’.
    my code is here…

    <section id="contact">
    	<h2>Contact</h2>
    	<?php if(get_post_meta($post->ID, "name", true)) { ?>
    		<p>
    			<span id="name"> </span>
    			<?php the_field('name') ?>
    		</p>
    	<?php } ?>
    	<?php if(get_post_meta($post->ID, "website", true)) { ?>
    		<p>
    			<span id="web">  </span><a href="#"><?php the_field('website') ?></a>
    		</p>
    	<?php } ?>
    </section>

    please help me..
    i’m not well in php.

    http://wordpress.org/extend/plugins/advanced-custom-fields/

Viewing 1 replies (of 1 total)
  • Plugin Author elliotcondon

    @elliotcondon

    Hi @safeer N

    I advise you to read up on the documentation at the ACF website. There are lots of code examples for the conditional statements

    Good luck!

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Advanced Custom Fields] check if any field of field group has value’ is closed to new replies.