The after_setup_theme hook is actually an action hook not a filter hook. Nonetheless that should not be needed.
Give this a try:
if( ! function_exists( 'get_field' ) ) {
function get_field( $key, $post_id = false, $format_value = true ) {
if( false === $post_id ) {
global $post;
$post_id = $post->ID;
}
return get_post_meta( $post_id, $key, true );
}
}
Related Posts:
- I have an fatal error on my funcyions.php
- How to override parent functions in child themes?
- Adding a second email address to a completed order in WooCommerce [closed]
- How to override a function when isn’t at functions.php
- functions.php inject inline css
- Removing custom background and header feature in child theme
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- syntax for remove_filter in parent theme with class
- Is it possible to override this function/class in a child theme?
- How to prevent deleting of comments when deleting a post
- Convert hyphen to underscore in permalinks
- Php string not working in WordPress Functions.php (trying to fetch 1st category for each blog that post appears in the sidebar)
- How to override filter in child theme?
- Customized wp_new_user_notification
- change default option in wp_dropdown_categories
- What is the criteria for pluggable functions?
- Where does function_exists() look to decide whether a function exists? [closed]
- How to use max and min values of custom fields
- Twenty Eleven Child theme error when attempting to use a rewritten function
- override pluggable.php functions
- Retrieve tags data in post body
- Run function when WordPress new multisite is created or ACF field is updated
- Having issues with a foreach inside of a shortcode with ACF gallery
- Override a theme function in a child theme?
- Get Current Post ID in functions php, meta query filter
- ACF not showing
- How to retrieve the values of a sub-field in the first and last row of an (ACF) repeater inside function?
- How to target post and pages and not all post types in admin?
- wp_star_rating() – Adding a 5 star rating system to theme
- Add php code to wp_print_scripts?
- Access category within rss2_head hook?
- Need to replace Currency Shortforms
- Can set_post_thumbnail be used to remove a thumbnail?
- Programmatically add Yoast meta description after post save
- Compare meta key to current date in pre get post
- Check from functions.php if function exists in footer.php
- overwrite code snippet from parent to child theme
- Using two loops in one WordPress template
- Solution dealing with Child Theme / Parent theme functions
- How to override this theme function in child theme
- Insert a field with PREG_REPLACE – strange behaviour
- Perform function on publish AND save (not just save)
- Display ACF category image on archive and single template files
- WordPress login set cookie that survive browser exit (wp_signon function)
- Featured Image and Tags problem
- Override a Post’s URL with Advanced Custom Fields Function
- WordPress Function Assistance with Loop
- How to show ACF value under post/page title in wp-admin
- How to display an image before title text in menu items
- Filter works on last selection but no others
- Login cookies blocked after customizing hashing method
- How to update an image attachment’s alt text from a custom field when saving a post?
- Help with with my function for wordpress
- ACF Date Form in Custom Admin Field
- Assign IDs to headings in ACF using functions.php
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- get_field() with ID in one signal filter not working
- Echo a String Based On Geolocation? [Woocommerce || ACF]
- Comment function for page
- ACF Filter return value
- WordPress reading old version of functions.php, breaks site
- Return ACF Field value function
- Different body image backgrounds on different pages, posts and categories
- update_post_meta not working in function
- Integrate WP Tiles into existing loop (index.php) and theme
- save_post hook – headers already sent?
- Retrieve array of attachment IDs attached to a given Post ID
- does acf_save_post cause endless loop?
- Call ACF data from functions.php [closed]
- Update post meta with wp cron
- Check if post is being published for the first time, or is an already published post being updated
- Enqueuing External Javascript functions.php
- Date/time limitation of posts where function must be executed
- Is there an alternative to get_template_directory_uri()?
- Word Press – Dynamic Content [closed]
- Footer disappears when using the_content ( )
- Get page id or status by private pages?
- Categories as main menu items and subcategories as nested lists
- woocommerce change currency per category [closed]
- I can’t seem to install Font Awesome locally [closed]
- New custom menu created. how to apply it?
- problem loading stylesheets to wp_head dynamically
- Unable to point the child theme directory even using get_stylesheet_directory()
- Need a method to prevent WP from adding in between my shortcodes
- Get the alphabetical sorted data with wpdb
- WordPress Check User Role Function (multiple roles)?
- struggling with syntax for the_post_thumbnail();
- Echo youtube code from url or shortcode
- Woocommerce Default sorting product by product type
- Display link to category over featured image
- Does hook have an effect on increasing the page load?
- Adding a schema code to one specific page using functions.php file
- price of product can’t return when get data of product in functions.php
- Re-style Login Form Whilst Keeping CSS Separate from Frontend CSS
- Can You Set A Minimum Image Dimension For Resizing Images?
- Creating a “Related Meta” type field?
- Language Switch Function
- Change category checkbox into radio button [duplicate]
- Functions.php in child theme that loads CSS file breaks website
- Change conditional tag in wordpress without editing the core files