• Hello,

    In a page, I’d like to display the menu if a checkbox is on “Oui” (yes).
    I have an error when I publish this code.

    <?php
    	$values = get_field('menu-site');
    	if(in_array("Oui", $values )){
    	?>
    		<?php
    		$menuClass = 'nav';
    		if ( 'on' == et_get_option( 'nexus_disable_toptier' ) ) $menuClass .= ' et_disable_top_tier';
    		$primaryNav = '';
    		$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false ) );
    		echo( $primaryNav );
    		?>
    	<?php
    	}
    	?>

    Could you tell me if you see an error in the code please?

    Thanks you

    https://wordpress.org/plugins/advanced-custom-fields/

The topic ‘ACF Condition’ is closed to new replies.