Skip to content

Instantly share code, notes, and snippets.

View sagarjadhav's full-sized avatar

Sagar Jadhav sagarjadhav

  • rtCamp Inc
  • Pune
View GitHub Profile
@sagarjadhav
sagarjadhav / contact-form-7.html
Last active September 9, 2016 14:01
Contact Form 7 Markup with Sass
<!-- Misc Form -->
<div class="rtp-form-field"><label for="your-name">Your Name <span class="required">*</span></label>[text* your-name id:your-name]</div>
<div class="rtp-form-field"><label for="contact-email">Email <span class="required">*</span></label>[email* email id:contact-email]</div>
<div class="rtp-form-field"><label for="company-name">Company Name <span class="required">*</span></label>[text* company-name id:company-name]</div>
<div class="rtp-form-field"><label for="street-address">Street Address</label>[text street-address id:street-address]</div>
<div class="rtp-form-field"><label for="apartment-suite">Apartment/Suite</label>[text apartment-suite id:apartment-suite]</div>
<div class="rtp-form-field"><label for="city">City</label>[text city id:city]</div>
<div class="rtp-form-field"><label for="state">State</label>[text state id:state]</div>
<div class="rtp-form-field"><label for="zip">Zip <span class="required">*</span></label>[text* zip id:zip]</div>
<div class="rtp-form-field"><label for="pho
@sagarjadhav
sagarjadhav / super-sized.css
Created February 13, 2013 10:25
Super-sized background Image
img {
height: auto;
left: 0;
min-height: 100%;
position: fixed;
top: 0;
width: 100%;
}
@sagarjadhav
sagarjadhav / child-menu-pages.php
Created March 5, 2013 09:19
Get Child pages of page according to their menu order in nav menu
<?php
/**
* Get Child pages of page according to their menu order in nav menu
*
* @return array ids of child pages order by their order in menu. FALSE on failure.
*/
function get_menu_child_pages() {
$menu_id = 0;
$current_page_id = get_the_ID();
$child_menu_list = '';
@sagarjadhav
sagarjadhav / gallery-slideshow.php
Last active December 15, 2015 03:29
Convert Gallery into Cycle Slideshow.
@sagarjadhav
sagarjadhav / media-taxonomy.php
Last active December 15, 2015 10:28
Media Taxonomy Support
<?php
/**
* Registers Taxonomies
*
* @since rtPanelChild 1.0
*/
function rtp_create_taxonomies() {
/* Post Custom Taxonomy */
@sagarjadhav
sagarjadhav / ajax-script.js
Created April 5, 2013 11:36
WordPress with ajax
/* Ajax Page Setup */
$page = jQuery('.link a');
$page.on('click', function (e) {
e.preventDefault();
var pageID = jQuery(this).attr('data-id');
var ajaxdata = {
action: 'load_pages',
page_id: pageID
};
@sagarjadhav
sagarjadhav / plugin.js
Last active December 15, 2015 23:59
jQuery Plugin Initial Code
/* Utility : Object.create dosen't work all browsers. */
if ( typeof Object.create !== 'function' ) {
Object.create = function( obj ) {
function F() {};
F.prototype = obj;
return new F();
};
}
(function( $, window, document, undefined ) {
@sagarjadhav
sagarjadhav / jquery-tab-plugin.js
Last active December 16, 2015 00:09
jQuery Tabs
/* Utility : Object.create dosen't work all browsers. */
if ( typeof Object.create !== 'function' ) {
Object.create = function( obj ) {
function F() {};
F.prototype = obj;
return new F();
};
}
(function( $, window, document, undefined ) {
@sagarjadhav
sagarjadhav / sticky-scroll-sidebar-within-content.js
Last active December 18, 2015 16:29
The Sticky Scroll Sidebar plugin is designed to allow an element to stick to the top of the screen as page scrolls down, but without moving outside of the parent container.
/**
* Plugin for sticky scroll sidebar within content.
*/
// Utility : Object.create dosen't work all browsers.
if ( typeof Object.create !== 'function' ) {
Object.create = function( obj ) {
function F() {};
F.prototype = obj;
return new F();
@sagarjadhav
sagarjadhav / post-attachment.php
Created June 20, 2013 10:36
Get WP Post Attachments
<?php
/* Get Children Images */
function rtp_get_post_attachments( $parent_id ) {
$args = array(
'post_type' => 'attachment',
'numberposts' => 3,
'post_status' => null,
'post_parent' => $parent_id,
'exclude' => get_post_thumbnail_id($parent_id)