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
- How can I edit the wp_parse_auth_cookie function from the pluggable file in my functions?
- Uploading images via ACF update_field function
- Adding fields to the “Add New User” screen in the dashboard
- Issues with title-tag and document_title_parts
- Programmatically Set First Image as Featured
- add_action in a function, is it possible?
- When is wp_trim_excerpt() called?
- Change parent theme file function in child themes functions.php
- Unable to get_the_content(); of a post in WordPress via AJAX
- Ajax call theme functions from front
- Show excerpt for only first post in query
- Publish/Update post is changing image links from file url to post url
- How to stop twenty fifteen theme from cropping featured images?
- Where do i create my own function in wp-admin
- Question about “wp_deregister_script()”
- Combine embed_oembed_html and oembed_result
- Load JS file only in specific template
- Why get_user_by() doesn’t work in my code?
- How to change value of variable in theme file with functions.php WordPress?
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Wildcard 301 Redirect Using Theme Function
- Changing the default view of “The Events Calendar” for mobile
- Hide empty custom field
- Which method is more correct for removing WooCommerce Extensions menu item?
- Help! Need a different logo on my main page from my other pages
- RSS feed including post updates
- How do I integrate my Child Theme into a Custom Template?
- Why are some custom javascript files working but some are not
- using enqueue_script in a shortcode isn’t working
- How to add user_registered time in human_time_diff() wordpress