Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author pluginsware

    (@pluginsware)

    Hi,

    As our locations are nothing but WordPress taxonomies, Please refer https://stackoverflow.com/questions/42620296/wordpress-how-to-get-term-name-from-term-id to get the location name using the location id.

    Thanks

    Thread Starter msslrb

    (@msslrb)

    Thank you! I got it 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 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Parent location’ is closed to new replies.