Skip to content

Instantly share code, notes, and snippets.

Sridhar Katakam srikat

Block or report user

Report or block srikat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@srobbin
srobbin / gist:3799775
Created Sep 28, 2012
Random Backstretch image
View gist:3799775
<script>
// Create an array of images that you'd like to use
var images = [
'image1.jpg'
, 'image2.jpg'
, 'image3.jpg'
];
// Get a random number between 0 and the number of images
var randomNumber = Math.floor( Math.random() * images.length );
@nrrrdcore
nrrrdcore / inset_input.css
Created Aug 9, 2012
The Perfect Inset Input CSS
View inset_input.css
input {
height: 34px;
width: 100%;
border-radius: 3px;
border: 1px solid transparent;
border-top: none;
border-bottom: 1px solid #DDD;
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF;
}
@ohiosveryown
ohiosveryown / change-class-on-scroll.html
Last active Oct 2, 2019
Vanilla JS – change/add class based on scroll position.
View change-class-on-scroll.html
// https://codepen.io/cmykw/pen/gemxJm
// layout
<nav/>
// style
<style>
body { min-height: 200vh; }
nav {
@GaryJones
GaryJones / readme.md
Last active Jul 14, 2019
Custom Featured Post Widget plugin: Skeleton for amending the output of the Genesis Featured Post widget.
View readme.md
@zxcvbnm4709
zxcvbnm4709 / gist:2656197
Created May 10, 2012
include jQuery in Chrome Console
View gist:2656197
var script = document.createElement("script");
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
@robincornett
robincornett / functions.php
Last active Aug 27, 2018
optional home.php--to show the posts (blog) page's title and content
View functions.php
<?php
// do NOT include the opening line! Just add what's below to the end of your functions.php file
add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' );
function rgc_posts_page_edit_form( $post ) {
$posts_page = (int) get_option( 'page_for_posts' );
if ( $posts_page === $post->ID ) {
add_post_type_support( 'page', 'editor' );
}
@badabingbreda
badabingbreda / oxygenbuilder2_manage_edit_column_apply_to.php
Last active Jul 16, 2018
Oxygenbuilder2 Template overview Add Column "Apply To" and "In Use"
View oxygenbuilder2_manage_edit_column_apply_to.php
<?php
/**
* Add a apply_to and in_use column to Oxygenbuilder2.0's ct_templates overview.
* It will:
* - tell you the rules on the templates
* - show you if a re-usable is being used on a post/page/cpt so if not, you can safely delete it.
*/
add_filter('manage_edit-ct_template_columns', 'add_new_ct_template_columns');
/**
@robneu
robneu / genesis-nav-space-fix.css
Last active May 21, 2018
Remove unwated space from nav elements on Genesis themes.
View genesis-nav-space-fix.css
/**
* The Default Genesis styles have a bug which causes extra unwanted
* space to display in the nav menu bar elements. This will remove the
* extra space cross-browser. The reason for the strange .001px font size
* is due to a bug on older Andorid devices.
*
* Note: I've used the default Genesis styles here as an example. The only
* actual change is the font-size rule on both selectors.
*
* Reference link: http://css-tricks.com/fighting-the-space-between-inline-block-elements/
@timothyjensen
timothyjensen / functions.php
Last active Feb 5, 2018
Get an auto generated post excerpt, or a manual excerpt if one has been set.
View functions.php
<?php
// Make sure to prefix the function if you do not use a namespace.
// namespace TimJensen\HelperFunctions;
/**
* Returns an auto generated post excerpt, or a manual excerpt if one has been set.
*
* @version 1.2.1
*
* @param int $post_id Required. Post ID.
@robincornett
robincornett / functions.php
Created Oct 31, 2017
Code to remove landing pages from site search results. Assumes that templates are in the templates directory inside the theme.
View functions.php
<?php
add_action( 'pre_get_posts', 'leaven_search_hide_landing_page' );
/**
* Remove landing pages from the search results.
*
* @param $query \WP_Query
*
* @return mixed
*/
You can’t perform that action at this time.