Home › Forums › Support › ACF True/False This topic has 3 replies, 2 voices, and was last updated 2 years, 11 months ago by Fernando. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts March 22, 2023 at 4:00 pm #2577738 Pete Williams I’m using GP Premium and the free version of Generate Blocks. I’m trying to use a Query Loop to include a <span> container when a True/False custom field with the name ‘affiliate_link’ is set to Yes(True). Is this possible via code? I’ve tried a few different things, but all I can get to display is either 1 or 0 depending on whether True or False is selected. Thakn you for your help. Pete March 22, 2023 at 5:27 pm #2577817 Fernando Customer Support Hi Pete, It’s should be possible. Try adding my-span-cont to the class list of the Container Block. Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/ Then, add this Snippet: add_filter( 'render_block', function( $block_content, $block ) { if ( !is_admin() && ! empty( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'my-span-cont' ) !== false ) { $mybool = get_field( "affiliate_link", get_the_ID() ); if( !$mybool ) { return ''; } } return $block_content; }, 10, 2 ); Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets March 23, 2023 at 12:27 pm #2579302 Pete Williams Perfect. Thank you, Fernando. Fantastic support! March 23, 2023 at 5:09 pm #2579548 Fernando Customer Support You’re welcome, Pete! Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In