GeoDirectory has a Company Logo field with the key logo. Add it to your post type so listing owners can upload a logo, then place the logo on the details page with GD > Post Images or GD > Post Meta.
Add the logo field
- Go to Places > Settings > Custom Fields.
- Find Company Logo in the list of fields you can add, and add it.
- Save. Users now see a logo upload on the add listing form.
Keep the key as logo. Other GeoDirectory widgets and add-ons look for that key.
Show the logo on the details page
Edit the Details Page template (GeoDirectory > Settings > General > Pages, Details Page) and add one of these where you want the logo.
GD > Post Images with Image types set to logo and Output Type set to Single image. Set Aspect ratio to “No ratio (natural)” so the logo isn’t cropped to 16:9, and pick a smaller Image size so a large upload doesn’t fill the column. As a shortcode:
[gd_post_images types="logo" type="image" aspect="n" image_size="medium" css_class="gd-listing-logo"]
Or GD > Post Meta with the key logo:
[gd_post_meta key="logo" show="value"]
Control the logo size
The image stretches to fill its container. To keep it small, give the block an extra class (as with gd-listing-logo above) and add CSS in Appearance > Customize > Additional CSS:
.gd-listing-logo img {
width: auto;
max-width: 150px;
height: auto;
}
To place the logo beside the title, put the Post Images and Post Title blocks in a columns block in the template. GD > Post Images also uses the logo as the first fallback when a listing has no photos. Full options: GD > Post Images and GD > Post Meta.