- This topic has 1 reply, 2 voices, and was last updated 1 year, 8 months ago by .
- The forum ‘General Discussion’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I'm trying to add an option to my posts to show or hide the featured image unsing Advanced Custom Fields. The True / False option is working well but I can't work out how to include the relevant code in functions.php
The below code removed the featured image but how do I get it working with ACF?
remove_action( 'genesis_meta', 'navigation_full_featured_image' );
remove_action( 'genesis_entry_header', 'genesis_do_singular_image', 1 );
Any advice would be really appreciated, I'm rubbish at this sort of thing.
You would need to use a custom function to check if ACF is true or false. https://www.advancedcustomfields.com/resources/true-false/
And wrap that code in a hook which executes before your remove action like genesis_meta with a 3rd parameter of 9. Untested but it should work.
To write the working code for this would require the setup of ACF using exactly the same settings as what you're using.
That should be enough to get you started.
© 2022 WPEngine, Inc.