Your question literally doesn’t quite sound like “combining” loops, that’s usually different thing in WP terminology.
Following it literally you already know the part that outputs artist name you want — the_field('artist_name')
.
What probably confuses it in first context is that it’s not really a normal WP loop. Note how that call doesn’t specify which post artist name should be for? That conventionally comes from global post if omitted. You are not setting up post globals at all in your first snippet.
Since the_field()
isn’t even WP function I assume you use one of numerous custom fields frameworks. You will have to consult its documentation how to retrieve the data for a specific post, provided by ID explicitly.
Related Posts:
- Calling Specific Pages with wp query Part II
- Calling custom fields for pages (not posts)
- get_posts that match a user-specified value on a page
- Meta Query returns wrong number of posts
- Delist entries in the_loop
- Loop through incrementing custom fields
- Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
- How do delete a meta key?
- Using meta query (‘meta_query’) with a search query (‘s’)
- How to enable custom fields for pages (if not a bad practice)?
- Query Posts or Get Posts by custom fields, possible?
- ORDER BY custom field value
- Can I query custom meta data through WP_Query
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How to add add_meta_box to specific Page Template?
- Matching Serialized Arrays with meta_query
- Meta Query with AND & OR?
- Having different sidebar content for MANY pages?
- Using get_posts with arguments found in meta keys
- Trying to perform complex custom field query with order by set to field value
- Is there a way to do multiple ordering on a multiple meta_query?
- Order posts by custom field and if custom field is empty return remaining posts
- WordPress Search Custom Meta Field Only
- Custom Page Template [closed]
- Compare meta_query decimals not working right
- change order of images attached to post
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Diamond question mark in text after migrating content
- ul list with only as many li’s as filled custom fields
- Price comparison table based on Custom Post Type?
- do_shortcode close
- Search Results Page – Displaying Custom Meta Fields
- tax query between operator like
- Display a different image for each page with editor
- Collect Data from NEXT item while in loop
- Custom field to array?
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- How to show content of custom fields in search results?
- Custom field outside the loop and inside an array
- Is it possible to compare the current time with a custom “start” and “end date
- Display metabox title for custom fields with values
- use custom field value as post category in loop
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- Filter or order based on custom field
- Display the output from Custom User Fields from a WordPress user profile on a WordPress Custom Page
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- Compare ACF date field (if exists) and post date and order DESC
- What am I missing in this Code Block?
- Making WP_Query limit results by date before today where date is a meta_query
- multiple meta_query and orderby question
- get_field values for each post on home page using wp_add_inline_style
- get posts based on non-single metadata
- Woocommerce products search with custom fields
- How to save multiple values with same meta_key, each value linked to another tag id
- How to improve my non-unique metadata MySQL entries?
- WP meta_query args not working in function
- Filtering posts by ACF meta query
- How do I display an article using a WordPress custom field?
- Why does my numeric meta query work only on one meta key and not the other?
- meta_query to check all custom fields
- User Filter Options on Archive Page
- Query multiple meta values at the same time :
- Sort loop by custom field from different post type
- Custom meta boxes – add php code inside?
- Create Shortcode shows only posts with custom_field meta
- get wordpress post loop by meta box date
- Outputting custom field on home.php not outside of blog list
- Load one page with parent and child pages
- How to exclude posts with empty and non-existent relational custom field with meta_query?
- Counting number of images from loop
- Page template is missing fields or is invalid when I updating the template
- Metabox value for post loop?
- meta_query ‘compare’ => ‘!=’ not working
- Get meta value when the page is a blog archive
- Create custom query for search?
- Filter query based on date in custom field
- Why is wp_list_pages altering $post->ID of the page?
- WP_query returns error when used for custom widget
- Custom Field select list is truncated
- Query Posts Via WordPress URL
- How to use page metadata while using wp_list_pages()?
- Getting content from custom fields of different pages on a single page
- Meta_query not filtering posts
- Decouple page name from page title
- Checking if field is set before comparing with meta_query in query_posts?
- I want my post to republish again after adding a custom field
- get_post_custom_values not working
- loop through custom post-type with two meta_keys
- Display posts where date field matches current month?
- Filtering posts by WORD in custom field
- Retrieve IDs from custom field, count and display results differently according to count
- Pagination not displaying correct number of pages
- Display custom field outside the loop
- Filter Query Post by Custom Fields(by date)
- Custom field not showing
- Order by a meta field in query loop
- Dynamic background image used in css after selector
- WP Query Args – search by meta_key or title
- get_the_ID() retrieves same ID on Gutenberg’s Query Loop