Skip to content

Instantly share code, notes, and snippets.

View amitabhaghosh197's full-sized avatar

amitabha ghosh amitabhaghosh197

View GitHub Profile
@amitabhaghosh197
amitabhaghosh197 / dabblet.css
Created May 7, 2013 23:11
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
<style type="text/css"> @import url(http://fonts.googleapis.com/css?family=Crete+Round:400italic); .yshortcuts { color: #EFC031; } /* mobile-specific CSS styles go here */ @media only screen and (max-device-width: 480px) { body { width: 320px !important; } h1[id=h1] { font-size: 2.2em !important; line-height: 1.2em !important; margin: 0 !important; } h1[id=h2] { font-size: 1.6em !important; line-height: 1.3em !important; margin: 0 0 1em 0 !important; } p[id=containerImgMembersDesktop] { height: 0 !important; overflow: hidden !important; display: none !important; } p[id=containerImgMembersMobile] { height: 95px !important; overflow: auto !important; display: block !important; margin: 0 0 1.5em 0 !important; } img[id=imgMembersMobile] { width: 300px !important; height: 95px !important; } p[id=containerImgFindDesktop] { height: 0 !important; overflow: hidden !important; display:
<?php
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
add_action( 'init', 'register_menu' );
@amitabhaghosh197
amitabhaghosh197 / facebook_like-box_responsive.css
Last active September 9, 2017 19:02 — forked from smeranda/facebook_like-box_responsive.css
Facebook responsive css #facebook-css #css
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
<?php
add_image_size('thumbnail-bw', 400, 0, false);
add_filter('wp_generate_attachment_metadata','bw_images_filter');
function bw_images_filter($meta) {
$file = wp_upload_dir();
$file = trailingslashit($file['path']).$meta['sizes']['thumbnail-bw']['file'];
list($orig_w, $orig_h, $orig_type) = @getimagesize($file);
$image = wp_load_image($file);
imagefilter($image, IMG_FILTER_GRAYSCALE);
function kickOffAjax(){
// we dont want to fire the ajax multiple times
opts.isDuringAjax = true;
// show the loading message quickly
// then hide the previous/next links after we're
// sure the loading message was visible
props.loadingMsg.appendTo( opts.loadMsgSelector ).show(opts.loadingMsgRevealSpeed, function(){
$( opts.navSelector ).hide();
jquery.isotope.min.js
jquery-latest.js
@amitabhaghosh197
amitabhaghosh197 / excerpt_class_function.php
Last active August 29, 2015 14:01
Excerpt_class wordpress function
<?php
// Just copy the code in function.php
?>
<?php
class Excerpt {
// Default length (by WordPress)
public static $length = 55;
@amitabhaghosh197
amitabhaghosh197 / children-api.js
Created May 20, 2014 13:22
children() api jquery
//Works for a children div
$( "div" ).children( ".selected" ).css( "color", "blue" );
//or
$( "ul.level-2" ).children().css( "background-color", "red" );
//more http://api.jquery.com/children/
<?php
/**
* Plugin Name: (#67107) »kaiser« Restrict file upload via image dimensions
*/
function wpse67107_restrict_upload( $file )
{
$file_data = getimagesize( $file );
// Abort when we can't get any info:
if ( ! $file_data )