Display City, State and Zip Code in Thumbnails

This topic contains 3 replies, has 3 voices, and was last updated by  Guust 10 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #10930

    directory
    Expired Member
    Post count: 1502

    How can I display the City, State and Zip code with the listing thumbnail?

    #10938

    Simone
    Expired Member
    Post count: 3515

    Hello, add this to the functions.php in your child theme. That will print out country region and city right below the title

    
    
    add_action( 'geodir_after_listing_post_title', 'country_listing', 45 );
    function country_listing() {
    global $post;
    global $wp_query;
    
    $postid = $wp_query->post->ID;
    $postcity= geodir_get_post_meta($postid,'post_city',true); 
    $postregion= geodir_get_post_meta($postid,'post_region',true); 
    $postcountry= geodir_get_post_meta($postid,'post_country',true); 
    
    echo $postcountry." - ".$postregion." - ".$postcity;
    
    }
    #10939

    directory
    Expired Member
    Post count: 1502

    Wow! That was fast, Simone! Thank you so much!

    #10964

    Guust
    Moderator
    Post count: 29970

    Or set “Show on Listing page” to Yes in address custom fields:
    http://goldroo.net/attractions/
    That’s for the non-coders 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount