Skip to content

Instantly share code, notes, and snippets.

@1naveengiri
Last active January 3, 2020 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1naveengiri/4f08fc198fc434e54dfcb50f6f5bcadb to your computer and use it in GitHub Desktop.
Save 1naveengiri/4f08fc198fc434e54dfcb50f6f5bcadb to your computer and use it in GitHub Desktop.
Change Geodirectory map popup layout for specific CPT.
<?php
/**
* I am changing map popup layout of gd_places here.
*/
add_filter('geodir_get_template_part', 'geodir_get_template_part_callback', 10, 3);
function geodir_get_template_part_callback( $template, $slug, $name ){
global $gd_post;
if( 'gd_place' === $gd_post->post_type ){
?>
<div class="gd-bubble" style="">
<div class="gd-bubble-inside">
<div class="geodir-bubble_desc">
<div class="geodir-bubble_image">
[gd_post_images type="image" link_to="none" ajax_load="0" show_logo="true" ]
</div>
<div class="geodir-bubble-meta-top">
[gd_post_badge key="website" condition="is_not_empty" badge="%%city_name%%" link="%%input%%" bg_color="rgba(0,0,0,0)" txt_color="#000000"]
[gd_post_title tag='h4']
</div>
<div class="geodir-bubble-meta-side">
[gd_post_content key="post_content" limit="20"]
</div>
</div>
</div>
</div>
<?php
$template = false;
}
return $template;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment