Support

Account

Home Forums General Issues Control Display of Custom Field Reply To: Control Display of Custom Field

  • Hi @toad78

    I think I misunderstood your question. I’m sorry about that.

    I believe you can add a post object field and then add the pages you want to exclude. After that, you can check if the current page is excluded or not like this:

    // Get the excluded IDs
    $excluded = get_field('excluded_pages_field', 163, false);
    
    // Get the current post
    global $post;
    
    //Check if the current page is excluded or not
    if( $excluded && !in_array($post->ID, $excluded) ){
        
        // Your code here
        echo "not excluded";
        
    }

    I hope this helps 🙂