Parent location on subsequent post
-
I got the listings to display the parent location. However, it displays the parent location of the post before it instead of the current post. Do you know how to correct this in my code?
$term_id = $location->parent;
if ( $has_location && $locations = wp_get_object_terms( $post->ID, ‘acadp_locations’ ) ) {
$location_links = array();
foreach ( $locations as $location ) {
$location_links[] = sprintf( ‘%s‘, esc_url(acadp_get_location_page_link( $location ) ), esc_html( $location->name ) ).”, “.$term_name = get_term( $term_id )->name;
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Parent location on subsequent post’ is closed to new replies.