Skip to content

Instantly share code, notes, and snippets.

Avatar

Sandeep Kumar wpflippercode

View GitHub Profile
@wpflippercode
wpflippercode / gist:c7c59e5da3be436dc8970f35c37e9335
Created Aug 3, 2016
Google Maps Fix for Tabby Responsive Tabs Plugin
View gist:c7c59e5da3be436dc8970f35c37e9335
add_action( 'wp_head','flippercode_maps_fix' );
function flippercode_maps_fix() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
$('body').on('click','.responsive-tabs__list__item',function(){
var id = $(this).attr('id');
if( id == 'tablist1-tab2') {
if(typeof map1 != 'undefined') {
@wpflippercode
wpflippercode / gist:1fc46599c6061c97e1d255161055618d
Created Aug 3, 2016
Google Maps Fix for Twitter's Bootstrap Tabs Plugin
View gist:1fc46599c6061c97e1d255161055618d
add_action('wp_head','flippercode_maps_fix');
function flippercode_maps_fix()
{ ?>
<script type="text/javascript">
jQuery(document).ready(function($){
$('body').on('click','.nav-tabs li',function(){
if(typeof map1 != 'undefined') {
$(map1).data('wpgmp_maps').resize_map();
}
@wpflippercode
wpflippercode / gist:36f3b309a6ec286aa0068b0d1b92e559
Created Aug 3, 2016
Google Maps Fix for Twitter's Bootstrap Modals
View gist:36f3b309a6ec286aa0068b0d1b92e559
add_action('wp_head','flippercode_maps_fix');
function flippercode_maps_fix()
{ ?>
<script type="text/javascript">
jQuery(document).ready(function($){
$("#yourModal").on("shown.bs.modal", function () {
if(typeof map1 != 'undefined') {
$(map1).data('wpgmp_maps').resize_map();
}
@wpflippercode
wpflippercode / gist:e9a02bc4eabb0b0098c6a6ffcfaa8ec4
Created Sep 8, 2016
Reset Zoom Level on Category Select in WP Google Map Pro
View gist:e9a02bc4eabb0b0098c6a6ffcfaa8ec4
add_action('wp_head','fc_reset_zoom');
function fc_reset_zoom() {
echo '<script>jQuery(document).ready(function($){
$("body").on("click","select[name=\"place_category\"]",function(){
var map_obj = $(map1).data("wpgmp_maps").map;
map_obj.setZoom(5);
});
});</script>';
}
@wpflippercode
wpflippercode / Function.php
Created Sep 24, 2016 — forked from fcgist/Function.php
Multiple Google Map Post markers on single page using ACF plugin
View Function.php
add_filter("wpgmp_markers","add_markers",1,2);
function add_markers($markers,$map_id)
{
global $post;
//echo '<pre>'.print_r($markers).'</pre>';
$new_markers = array();
$the_query_map = new WP_Query( array( 'posts_per_page' => -1 ) );
if($the_query_map->have_posts()) :
@wpflippercode
wpflippercode / gist:6e2b43fe7b622de8d81e7199cafc237e
Created Sep 27, 2016
Use own listing html with WP Posts Pro Plugin
View gist:6e2b43fe7b622de8d81e7199cafc237e
add_filter('wpp_layout_modifier', 'wpp_layout_modifier', 10, 2);
function wpp_layout_modifier( $layout_content,$post_id ) {
// Define your own html here and use placeholders e.g {title}, {date} etc.
$layout_content = '<div class="wpp_post" itemscope="" itemtype="http://schema.org/Article">
{title}
<div class="wpp_meta">
<span class="wpp_date">{date}</span>
<span class="wpp_author">{author}</span>
<span class="wpp_comments">{comments}</span>
</div>
@wpflippercode
wpflippercode / gist:e0853d2797793a7707e5b68314de2694
Created Sep 27, 2016
Remove icons from post's meta information in wp posts pro plugin.
View gist:e0853d2797793a7707e5b68314de2694
add_filter('wpp_comments_icon','wpp_comments_icon');
function wpp_comments_icon($icon) {
$icon = '';
return $icon;
}
add_filter('wpp_date_icon','wpp_date_icon');
function wpp_date_icon($icon) {
$icon = '';
return $icon;
@wpflippercode
wpflippercode / gist:4af234bf9f31c2e350ab5740bc86c6ef
Created Sep 27, 2016
Modify Featured Image markup in posts listing using wp posts pro plugin.
View gist:4af234bf9f31c2e350ab5740bc86c6ef
/**
* Modify featured image html.
* @param string $thumbnail Default featured image markup.
* @param int $post_id Post ID.
* @param int $thumbnail_id Attachment ID.
* @return string Modified featured image markup.
*/
function wpp_thumbnail_html( $thumbnail,$post_id, $thumbnail_id) {
$image_attributes = wp_get_attachment_image_src( $thumbnail_id,'thumbnail' );
@wpflippercode
wpflippercode / gist:7ed4735bb523bcfdab129222c215e72f
Created Sep 27, 2016
Use own data placeholder in posts listing using wp posts pro plugin.
View gist:7ed4735bb523bcfdab129222c215e72f
add_filter('wpp_posts_data','wpp_posts_data',10,2);
/**
* Modify Post's Data before placing in the template.
* @param array $placeholder_data Post's Data.
* @param int $post_id Post ID.
* @return array Modified Post's Data.
*/
function wpp_posts_data($placeholder_data,$post_id) {
@wpflippercode
wpflippercode / gist:cc52e76806cee8b8289a550e0b74734c
Created Nov 22, 2016
Modify Maps & Listing Position using wpgmp_map_output hook
View gist:cc52e76806cee8b8289a550e0b74734c
add_filter("wpgmp_map_output","wpgmp_map_output",2,4);
function wpgmp_map_output($output,$map_div,$listing_div,$map_id)
{
$output="
<table width='100%'><tr><td width='50%' valign='top' style='vertical-align:top;'>".$listing_div."</td><td width='50%' valign='top' style='vertical-align:top;'>".$map_div."</td></tr></table>";
return $ouput;