The method to use is…
In the acf_add_options_sub_page
declaration, add 'post_id' => 'article'
as a parameter. (post_id)
This is how the field data, as entered on the Options page corresponding to my post type, will be saved.
On the display end, display using $featured_posts = get_field('featured_posts', 'article');
‘article’ and ‘report’ are both used.
In my case, at the display end, I use $queried_object->name
to dynamically infer either ‘article’ or ‘report’ post types.
Credit hube2
Related Posts:
- Use Acf Repeater data as options for a different acf custom select field
- Filtering multiple custom fields with WP REST API 2
- Front end form to create a custom post with preview
- Generate a excerpt from an ACF-wysiwyg-field
- Pods cms and “advanced custom fields” plugin
- Adding a body class with ACF
- Returning all radio button options when using Advanced Custom Fields
- Order and group posts by acf by month and year
- Vimeo thumbnails [closed]
- pre_get_posts filter using numeric meta_query comparison (from dates)
- ACF + contact form 7
- Is there a way to export Advanced Custom Fields data?
- Advanced Custom Fields plugin : displaying a YouTube video
- WordPress Gutenberg, update post content programmatically
- How to add custom fields in rss feed
- Replace post’s “the_content” with ACF value
- PHP echo stripping formatting in Advanced Custom Fields [closed]
- How to upload multiple images on frontend to ACF gallery using update_field
- Add user custom fields and make editable on frontend
- Inconsistent behavior from number_format
- Display post in order of ACF checkbox?
- ACF custom block get_field() shows null on front-end? [closed]
- How to display genre of music content from one page to another page in wordpress
- ACF Update_field() update the field but changes are not seen in backend or rest api
- How to decrease the number of queries with get_posts and ACF?
- How to make Advanced Forms (and/or ACF) encode input value?
- ACF: How to make get_field() ignore the main wp query?
- ACF Wysiwyg Editor Image srcset for responsive images [closed]
- User meta not saving properly
- Filtering from advance custom field data
- Is there a better way of retrieving the name of an acf pagelink type from current post?
- Seemingly Simple Conditional Won’t Work?
- Prepared statements used incorrectly in ACF?
- Not displaying posts that are in the past. ACF date > date
- acf repeater was free in start [closed]
- Use ACF select field to add a class to div inside a flexible content layout [closed]
- How to See Everything in get_option()?
- Hide ACF from source code until a “show” button is clicked
- Pull info from Soundcloud embed into a custom field?
- How to disable field on Advanced Custom Fields? [closed]
- Outputing Post Object title as a div class with ACF
- Can you make a custom gutenberg block that allows the gutenberg editor within it?
- Add original validation rule to Advance Custom Fields
- ACF – Pick first or second value from comma separated values
- ACF Clone Field – Set Default Value
- How to get ACF value inside Gutenberg Block from another page or template? I’m using Timber too
- ACF Maps admin error: “For development purposes only” even after supplying api key
- Frontend Form Checkbox Update ACF Field
- ACF and Gravity Form file upload frontend [closed]
- Trying to select 1 item from an array
- Query and display only by first letter of the get_field value
- ACF google map not working [closed]
- Sorting get_terms, ACF is automatically removing duplicates
- Help using acf/save_post hook to connect to Untappd API and update_field [closed]
- Get ACF fields in relationships of returned post
- Random images with no duplicates (ACF Gallery) [closed]
- Only Show an Advanced Custom Fields custom field on a specific template
- Advanced Custom Fields plugin : displaying a field while omitting the p tags
- getting image from ACF
- ACF: If field contain a specific value, update value in another field
- Equation input with preview in classic editor
- How to show related post having same relationship filed under single CPT?
- Update field for repeater not working
- How can i add service category here? [duplicate]
- Can’t get the frontend cache to be deleted manually
- How to do a WP_Query when a post has a relationship to anoter post via an ACF Post Object field, where the related post is in a certain category?
- Custom ACF block only outputs commented JSON to the DOM
- Populating ACF Image Fields from JSON file
- WP get_posts meta_query using ACF repeater field
- get_posts filter meta_query using ACF Checkbox
- Advanced Custom Fields | Help me link to a variable
- Field has disappeared on post page
- ACF Flexible Content with Bootstrap Carousel Repeater
- Which is faster: Loading images from the repo, or loading them using ACF Image Content via Media Library
- Display posts every specific day
- How to use germ_terms() with meta_query for ACF Taxonomy field?
- Hide Menu Items from guess user with ACF
- Advanced Custom Fields Gallery and Flex Slider [closed]
- WordPress API response filter by ACF value
- advanced custom fields if field has value show main div [closed]
- Display custom image field in user profile
- wp_split_shared_term_batch messing up upgraded ACF 5 data
- Build table using Advanced Custom Fields
- Populate ACF repeater with current structure of pages
- Can’t get ACF repeater data in category template
- ACF scheduled repeater fields
- Get the category fields even if there is no post
- display content in ascending order
- Advanced Custom Fields Show After Password [closed]
- Add routes between multiple ACF google maps markers [closed]
- Displays a string of linked images
- use advance custom field inside query post command [closed]
- Hebrew WP 3.5: plugin activated, does not appear in sidebar [duplicate]
- How to share specific data contained in repeated fields across multiple pages
- ACF gives a syntaxError unexpected token
- Using ACF on Posts Page
- Advanced custom fields if else statement
- Advanced custom fields and post types
- Custom headings on WYSIWYGs per flexible content module in ACF
- Pending posts showing category until published