if the artist names and track names are in matching order and the same in number then:
<?php
$artists = get_post_custom_values('Artist', $post->ID);
$tracks = get_post_custom_values('Track', $post->ID);
$i=0;
foreach ( $artists as $key => $value ) {
$class = ( $i % 2 ) ? 'alternative' : ''; // modulus operator
echo '<li class="' . $class . '">';
echo $value . ' - ';
echo tracks[ $i ] . '</li>';
$i++;
}
?>
otherwise if there is some other way they are matched up you need to figure that out in the loop.
Related Posts:
- Make Selected Mutiselect Items “selected”
- Struggling with array and foreach loop
- Do not replicate items if they exists in a foreach loop
- How to randomise my menu items?
- Why does get_users suddenly return duplicates?
- Updating wp_options with an array on save_post results in duplicated entries
- post__in – Placing content from a foreach loop inside of an array
- Need to get specific data from array
- How do I update a specific object in an array, in user meta?
- Create an array from an array
- How to save array of datas in option page by setting api?
- How to check an array of $curauth fields?
- How to fetch an array in $wpdb?
- Must Use Plugin Causing Query Error
- How to convert objects into arrays
- Admin Options page. Save as Array
- PHP get the first post separately from array returned by wpdb->get_results()
- how can i show only the parents in owl-carousel?
- Only a part of array is stored in transient – what could be causing this?
- How can I add multiple ‘tax_query’ arrays via a loop?
- Call global variable array() in woocommerce child/template
- How to get update_post_meta output to include string length
- Return array keys and values
- Echoing a variable inside a function
- How to pass conditional array to wp_localize_script
- foreach loop still echoes array
- Using Wishlist Member and I need to access a user’s status
- WordPress i18n in Array throws Error
- Save meta box values as an array to wp_postmeta
- meaning of (array)function()
- Create menu locations for each category in wordpress
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- Add first letter of titles to array, then compare arrays
- How to use if statement in an array? [closed]
- Output meta into arrays
- Get html data with javascript to php array and store to wordpress database
- How do I create a numbered list with PHP? [closed]
- Saving array keep adding length of array
- How to use array in function to get only value I want
- How to get a page array and category array going at the same time?
- get_the_terms, whether I should use string or array as the second parameter?
- Warning: in_array() null given in PHP function
- Foreach loop inside an array_merge
- Obtaining array item from WordPress revisions output
- How to access or parse key/values that have “string”
- Conditional multidimensional arrays and array_map
- Getting posts to exclude from array
- extract serialized array to use for wp-query
- get users search not working with array
- How can I split my query result in 2 arrays?
- Multidimensional Array
- Order a WP_Query by meta value where the value is an array
- How to put an array in wp user query
- Get the values from an array string to work with post__in
- ACF checkbox array is returning numbers, not labels [closed]
- How to make sure relative URL works when site is not on root domain?
- Get URI from PodPress using PHP
- Get array value
- Finding and removing duplicates within WP Arrays
- Ways of dealing with nested arrays within option
- Using multiple variables to assign categories to an array
- Custom functions for string data calculations
- Repeat a function with 24hrs gap for n number of days
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Order users by random not working?
- WordPress, result array of ‘post_name’
- how to separate an array into different arrays and save them into db?
- WP post meta – for loop inside for loop
- Combine multiple queries, array_unique returns nothing
- Store custom field’s multiple values in one user meta key
- wp_update_post to set post IDs to drafts not working
- get_users when from meta key that has serialized values
- make an array in wordpress cusmization api?
- Trouble with checked() for array of multiple checkboxes
- How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]
- Get a list of tags present in a paged front page
- WPML admin texts with serialized objects
- Add custom filter to register data in array
- WP_Post is not from correct array
- Auto remove empty values in array
- Create dropdown menu of all tags used in category
- Display a post based on its metabox selection
- Adapting a php array to WordPress
- wp_get_archive for category returning different URLs on different but similar sites
- Get custom_user meta value and add entry
- How do I retrieve an array from wp_postmeta with get_post_meta?
- Accessing value from associative array
- How to print array of specific item
- How to check if the postID is in an array? [closed]
- What is this mark for “? function()” [closed]
- How to combine array info [closed]
- Marketpress php warning on server, no problem on localhost [closed]
- Insert data into custom table from fetching $_POST values
- Force array to be a string [closed]
- get_body_params() is always empty in POST request
- save array of objects with update_option
- Multipe array in meta_input
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Replace block content with an array
- Adding date and time to the same request