• Resolved msslrb

    (@msslrb)


    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)
  • Plugin Author pluginsware

    (@pluginsware)

    Hi,

    Kindly make sure the $post->ID in your code returns the current POST ID. That should be the reason for the issue. Kindly get me the exact page link where you use this code. So, I can get a clue about the issue.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Parent location on subsequent post’ is closed to new replies.