Skip to content

Instantly share code, notes, and snippets.

View amitabhaghosh197's full-sized avatar

amitabha ghosh amitabhaghosh197

View GitHub Profile
// Hide admin-bar from frontend when logged in
add_action('admin_bar_init', 'my_admin_bar');
if(!function_exists('my_admin_bar')){
function my_admin_bar()
{
remove_action('wp_head', '_admin_bar_bump_cb');
add_action ('wp_head', '_admin_bar_new');
@amitabhaghosh197
amitabhaghosh197 / Add searchform template
Created August 27, 2014 14:25
Searchform Template.php
And in required place add
<?php get_template_part('layouts/templates/searchform', 'header'); ?>
@amitabhaghosh197
amitabhaghosh197 / hide _cmb_metabox_id_from_a_page_id.php
Last active September 9, 2017 18:58
hide _cmb_metabox_id_from_a_page_id #wordpress #metabox #meta-box
<?php
/**
**Hide a particular metabox id from a page id
**Inspirations:
** 1. http://www.farinspace.com/page-specific-wordpress-meta-box/
** 2. http://wordpress.stackexchange.com/questions/50732/possible-to-limit-custom-meta-boxes-depending-on-what-page-template-is-used
** 3. http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head
** I have to hide 'test_image_id' from the page id 38
@amitabhaghosh197
amitabhaghosh197 / google-map-js.php
Last active September 9, 2017 18:57
Google Map API js for wordpress #gmap #map #wordpress
<?php
function google_map_js(){?>
<?php if (is_page(403)) { ?>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
@amitabhaghosh197
amitabhaghosh197 / woocommerce-add-custom-field.php
Last active September 9, 2017 18:56
woocommerce-codes #wordpress #woocommerce #important
// [Ref:][http://www.remicorson.com/mastering-woocommerce-products-custom-fields/]
/*===================================================================
== FUNCTIONS FOR FREE PRODUCT & TOTAL PRODUCT
====================================================================*/
/****************CUSTOM FIELD FOR CUSTOM GENERAL FIELD**************************************************/
// Add Free Number Custom Field in Woocommerce
//Display Field
<?php
/*
Plugin Name: Easy Digital Downloads - Sample Gateway
Plugin URL: http://easydigitaldownloads.com/extension/sample-gateway
Description: A sample gateway for Easy Digital Downloads
Version: 1.0
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
@amitabhaghosh197
amitabhaghosh197 / google-maps-example.html
Last active September 9, 2017 19:03 — forked from ChrisLTD/google-maps-example.html
Google Map #google-map #gmap
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js"></script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px;"></div>
@amitabhaghosh197
amitabhaghosh197 / div-inline-shortcode.php
Created October 13, 2014 13:41
div with inline style shortcode plugin wordpress
<?php
/*
Plugin Name: Div Shortcode
Plugin URI: http://www.billerickson.net
Description: Allows you to create a div by using the shortcodes [div] and [end-div]. To add an id of "foo" and class of "bar", use [div id="foo" class="bar"].
Author: Bill Erickson
Version: 2.1
Author URI: http://www.billerickson.net
*/
@amitabhaghosh197
amitabhaghosh197 / main.html
Created October 19, 2014 20:39
display table with rounded corners
.section-front-about-container .latest-news
{
margin : 0;
padding : 0;
}
.section-front-about-container .latest-news > ul
{
list-style : none;
@amitabhaghosh197
amitabhaghosh197 / index.html
Last active September 9, 2017 18:55
Javascript Scroll to next page section #jquery #scroll
<a href="#testimonial-01" class="go-down scroll" rel="testimonial-01_link"><i class="fa fa-angle-down"></i></a>
rel="testimonial-01_link" <-- is the next div testimonial-01 id