When there are no posts, there is no post ID for get_field_object to operate with. If you read the docs for that function, you’ll see:
$post_id Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc
Related Posts:
- Filter by custom field in custom post type on admin page
- Media library – Limit images to custom post type
- How to add a post slug to a url?
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- Query filter by value in meta_value array
- Filter posts by their related field’s custom field
- Grouping and paging CPT events by month with custom field date
- Filter Content on all Post Types
- using ACF datepicker to filter posts on a page
- Filter page ID outside the loop and order
- How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?
- How can I remove the “Add New” button in my custom post type?
- How to remove Filters from post admin page?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- How can I filter posts by post_parent in the admin?
- How do I filter the excerpt metabox description in admin?
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Filtering a WP_Query meta_query by numeric values isn’t working
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Filter by custom Field for Custom post type Admin Listing
- Remove wpautop from all posts/pages except my custom post type
- Remove date and category filters when editing custom post types
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Exclude custom function content from certain pages
- Filter get_categories() for taxonomy term in WordPress
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Multiple post types in archives (filter?)
- Highlight nav menu terms
- Want to filter only parent post in admin area
- Filters post in admin with dropdown select, custom post type
- Admin List Dynamic Heading
- Change message given when deleting post from custom post type
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Add $more_link_text parameter to the_excerpt()
- Custom Taxonomy breaking pages permalinks
- Query Custom Post Types by date (custom field) range
- ACF simple text field value not showing
- Filter categories of posts with checkboxes
- Post Object Filter by Custom Field, not title (ACF)
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- Custom query to filter posts that have current post as a taxonomy [closed]
- Multiple ACF Repeaters within a Custom Post Type
- How to change post featured image using a custom field of category?
- Setting proper query for multiple custom admin filters
- Custom fields vs. Custom post types for a Portfolio Website
- How can I see a list of my Custom Post Types of the last term I was in?
- Add custom ID to CPT posts only create not update
- How to filter wp_list_categories output with some custom post type meta query?
- WP_Query order by custom field, then randomly order some of results
- creat filter with wp_query
- How to render a custom post type template with custom fields using shortcode
- How to query WordPress posts bycustom field with a max characters’ length
- Categories filtering in new post
- Displaying custom field according to date
- Create new custom post and post category of same name
- Sort a custom post with ACF: Date Picker & Display Featured!
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Custome fields not displayed
- How do I add custom HTML to the content of an archive page’s posts?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- Create short URL with auto 301 redirect
- Why is wp api returning old acf values?
- get custom post type value in header.php [closed]
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- Custom post types, disable fields
- Modifying WP_Title For Custom Post Type
- wp-includes does not contain a feed template
- Excerpt length: get first paragraph
- custom filtering admin columns
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- count & sum the value of custom field of the author post in dynamic posts
- Orderby custom fields is not working
- Display a Custom Post Type with Advanced Custom Fields on Homepage
- Filter result of Custom Post Type using meta_query with ACF
- Display category filters for custom post type when category is shared by multiple post types
- Same custom post type with different ACF
- Custom sorting in post columns by ACF Pro Select Field
- Create Post Types from a XML url (Real Estate website)
- Post Click Redirect to Custom URL instead of Single Post Page
- Subpages URLs for Custom Post Type
- Custom post type not pulling CSS
- How to show link to product in custom fields?
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Looping through image object using ACF and CPT UI [SOLVED]
- Keep br tags from stripping
- WordPress page not showing up – replaced with last 10 posts?
- Custom permalink rewrite rules – how do I fix this?
- Best way to have one product in both rental and sale parent category
- How do I display specific custom posts, and how do I edit a post’s singular page?
- Showing custom post user wise with different color in wordpress
- Submit and edit font end custom post type
- How to make a custom search template for custom taxonomy?
- Advanced Custom Fields – Add Field to Specific Page [closed]
- Sorting on Taxonomy in archive page
- Modifying and Displaying URL’s in a Post Template using parse_url
- WooCommerce – Complete Order when an action occurs
- add_filter > posts_where works partially
- WordPress Loop trouble with ACF [closed]