Nevermind, I figured this out.
The id needs to be “category_” and then the ID.
So the code is:
$sub_heading = get_field("sub_heading", "category_" . $cat->term_id);
Related Posts:
- How to loop only categories without posts (+ show category featured image with acf) [closed]
- How to query categories with Advanced Custom Fields?
- ACF no print data [closed]
- How can i add service category here? [duplicate]
- How can I add different custom fields for each category in the same post?
- How to create a category loop on my blog (ACF Plugin)
- How to loop through a custom field for each post, & display?
- ACF plugin categories bug in WordPress 3.9
- My Query is getting the wrong data
- Show Posts from Single Category Not Working
- Notice: Trying to get property of non-object in : custom fields category
- Is there a reason I cannot get the current category in a loop?
- Category archive is displaying all posts rather than the specific category
- Pagination on category.php and tag.php not working
- new WP_Query all post in a category inside the loop
- Trying to get variables in hacked category dropdown
- Problem with different query loops (and “main loop”) on category template page!
- How to do paging in the loop?
- How to add orderby parameter for sorting on category.php
- category__not_in and id values from variable
- echo get_post_meta of all post in a category to fill up a select field
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- How to loop custom post_type from (a) specific category(ies)?
- Do not show sub categories in the loop on archive-product.php
- How to display a value inside a post with a specified category from a category custom field? [closed]
- How to display the parent category if only the child category has been chosen
- Category tags with comma’s
- Display posts of certain categories to specific user roles
- Allow user to select categories that will display in post loop
- Insert HTML content in WP Query at specific point
- “Virtual category page” based on a custom field filter
- ul list with only as many li’s as filled custom fields
- Query (built in) Categories and Advanced Custom Fields?
- Simple way to style posts of a single category differently in the loop and in single
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- Getting the Most Recent Posts from Multiple Categories
- Display subcategories in dropdown
- Display category title and three latest post inside the category
- More efficient way to list posts by category [duplicate]
- Have posts that belong to multiple categories, exclude some categories from homepage
- Category nicename inside loop in wordpress
- Show multiple categories in query using redux framework variable
- Get the ID of the current post’s child category
- filter a loop base on specific category
- Problem with multiple loops in wordpress theme
- If custom field is empty, use one from a previous post
- multiple values in an array for category__and does not work with WP_Query
- Limit Loop to One Category
- Displaying a custom field in Category Archives
- Display post thumbnail for specific category outside the loop
- List post only under the category, exclude child category content
- Assign a custom post to a custom taxonomy based on custom field value
- Filter Category Loop Dynamically
- Editing Loop So It Targets Specific Tags?
- the_category() doesn’t working in wp_query loop
- Conditional category query breaking?
- Problem: retrieving parent category’s first post
- Custom Fields Value As Taxonomy
- Update custom category fields front-end
- How to get posts using category slug in ClassiPress?
- What is the best way to add an advanced / intermediate / beginner tag to a post
- Category sticky latest
- Show posts from category specified using a custom field
- Posts made to category don’t show up (do show up on frontpage)
- Adding tinymce to Custom Field boxes on Category edit page
- Exclude posts without category from loop
- Category name for all posts getting assigned to a single random post
- Category post count is not correct
- Display all categories but only if they have posts in them that have a specific tag assigned
- What am I missing in this Code Block?
- Include last post date in get_categories loop
- Only the most recent post is showing on my category page (working on localhost, not live site)
- get_field values for each post on home page using wp_add_inline_style
- Show the number of the post
- Sort categories by custom field in WordPress admin
- How can I order all subcategories alphabetical independent of the parent categories?
- How to get specific (grand parent) category of current post?
- Custom Loop with certain number of one category
- how tho change number of posts in loop from specific categories
- How to set acf color field as background color to product category
- Template category.php with page (no posts)
- Modifying category order
- Displaying data from custom fields on a specific category page
- error in specific category loop
- loop in single.php of the same category
- How to display custom fields as table in Woocommerce
- Please tell how to stop the category from showing up on posts
- Hide a category/posts from the homepage in wp
- How to modify custom category field from front end?
- Loop by category and meta_key
- ACF Custom field not showing in Timber Taxonomy page
- Ajax Category add doesn’t update the list table custom column
- In ACF, how to show custom category selection tab upon selecting a main category
- Assign a class to first element in category in loop
- Displaying Category in sidebar post widget but not in the loop on home
- Querying posts from two different categories while looping inside another loop
- Trying to display all posts in a category
- Counting number of images from loop
- How to Manage and link certain custom taxonomy?