Replacing the Google Map with Featured Image

Photo, amazing way to showcase your architecture, photography or artistic projects | Support forum.
GK User
Fri Feb 26, 2016 4:52 pm
Hi All,

Just wondering if there's a way to display the featured image instead of Google Map, just like other posts and pages.

Thanks in advance!!

Regards,
A.
User avatar
Fresh Boarder

Joshua M
Sun Feb 28, 2016 5:45 pm
Hi,
Yes, it's possible, please remove all "map" and "gk-map" classess from your "Location" page and upload a featured image - but some elements of this section layout and functionality may be lost.
User avatar
Moderator

Joshua M
Sun Feb 28, 2016 5:51 pm
Sorry, please ignore my previous post - I was thinking about the Steakhouse theme.

For the photo, you have to edit Photo/template.contact.php file and replace the following fragment:
Code: Select all
<?php if (get_theme_mod('photo_contact_enable_map', 1) == 1) : ?>
         <div class="gk-map-contact entry-header">
            <div class="gk-map static" data-latitude="<?php echo get_theme_mod('photo_contact_latitude','-34.397'); ?>" data-longitude="<?php echo get_theme_mod('photo_contact_longitude', '150.644'); ?>" data-ui="<?php if(get_theme_mod('photo_contact_enable_ui', 1) == 1) { echo 'yes'; } else { echo 'no'; } ?>" data-zoom="<?php echo get_theme_mod('photo_contact_map_zoom','8'); ?>"></div>
         </div>      
         <?php endif; ?>


with:
Code: Select all
<?php $thumb_full = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full');
    $image_url = $thumb_full[0]; ?>
         <header class="entry-header<?php if ( '' == get_the_post_thumbnail()) : ?> no-image<?php endif; ?>"  <?php if ( has_post_thumbnail()) : ?> style="background-image: url('<?php echo $image_url ?>');"<?php endif; ?>>
    <?php if ( has_post_thumbnail() && !post_password_required() ) : ?>
    <?php do_action('photo_before_post_image'); ?>
        <div class="entry-thumbnail">
                <?php echo gk_post_thumbnail_caption(); ?>
        </div>
        <?php do_action('photo_after_post_image'); ?>
    <?php endif; ?>

    <?php if(is_sticky()) : ?>
        <sup><i class="gk-icon-star"></i></sup>
    <?php endif; ?>
</header>
User avatar
Moderator

GK User
Tue Mar 01, 2016 7:41 am
Thanks, it works.
The only thing is the top spacing - I've added margin-top: -164px and it is all working perfectly.

Thanks again!

Cheers.
User avatar
Fresh Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.