Support

Account

Home Forums ACF PRO Conditionally loading template part

Solved

Conditionally loading template part

  • Hello, I would like to use the true/false field type in order to conditionally load a template part. If true it’s loaded, if false nothing should happen. Could anyone please help me out with a snippet?
    Thanks a lot, Ralf

  • I found the solution myself, thanks however for the attention! This is what worked for me:

     
        $field = get_field('showmap');
    
        if($field == '1'){
            echo 'content';
        }else{
            echo 'no content';
        }   
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.