I have two custom message types: Artists and Painting . Both types of messages have a custom field called the artist name created using the Advanced Custom Fields plugin. I need to be able to map custom fields from both of these message types to each other in order to display additional information.
The box below only the arguments and loops from the query. If you want, add more code.
<?php
$artist_name = get_field('artist');
$args = array(
'post_type' => 'artists',
'meta_value' => $artist_name
);
$query_artist = new WP_Query( $args );
if ( $query_artist->have_posts() ) {
while ( $query_artist->have_posts() ) {
$query_artist->the_post(); ?>
<p class="artist-name"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<?php }
} else {
echo 'Artist not found';
}
wp_reset_postdata(); ?>
, , " " . , . . -, , , ?
.