Hi Christian,
Install code snippets plugin and then use this code.
https://wordpress.org/plugins/code-snippets/
function modified_sd_homepage_featured_content() {
if (is_singular() && geodir_is_page('location') && $location = sd_gd_current_location_name() ) { ?>
<h1 class="entry-title"><?php echo esc_attr(__($location, 'geodirectory')); ?></h1>
<?php } else { ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php }
$sub_title = get_post_meta(get_the_ID(), 'subtitle', true);
if (geodir_is_page('location') && defined('GEODIRLOCATION_VERSION')) {
$loc = geodir_get_current_location_terms();
$location_type = geodir_what_is_current_location();
$country_slug = '';
$region_slug = '';
if ($location_type == 'city') {
$slug = $loc['gd_city'];
$region_slug = isset($loc['gd_region']) ? $loc['gd_region'] : '';
$country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : '';
} else if ($location_type == 'region') {
$slug = $loc['gd_region'];
$country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : '';
} elseif($location_type == 'country') {
$slug = $loc['gd_country'];
$country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : '';
}
else {
$slug = '';
}
$seo = geodir_location_seo_by_slug($slug, $location_type, $country_slug, $region_slug);
$tagline = (isset($seo->seo_image_tagline)) ? __($seo->seo_image_tagline, 'geodirlocation') : '';
if ($tagline) {
$sub_title = stripslashes($tagline);
}
}
if (isset($sub_title)) {
echo '<div class="entry-subtitle">' . $sub_title . '</div>';
}
sd_search_form_shortcode();
?>
<div class="home-page-ad">
Ad code goes here
</div>
<?php
echo do_shortcode('[gd_popular_post_category category_limit=5 category_restrict=1]');
echo '<div class="home-more" id="sd-home-scroll"><a href="#sd-home-scroll" ><i class="fa fa-chevron-down"></i></a></div>';
}
add_action('init', 'modified_sd_homepage_featured_content_init', 4);
function modified_sd_homepage_featured_content_init() {
remove_action('sd_homepage_content','sd_homepage_featured_content');
add_action('sd_homepage_content','modified_sd_homepage_featured_content');
}