Skip to content

Instantly share code, notes, and snippets.

@dsmy
dsmy / Medium.com style header effect
Last active August 29, 2015 14:05
A Pen by dsmy.
Medium.com style header effect
------------------------------
Forked from [Chrysto](http://codepen.io/bassta/)'s Pen [Medium.com style header effect](http://codepen.io/bassta/pen/iIskw/).
Resolved issue where content section needed a fixed height to allow for random content lengths.
A [Pen](http://codepen.io/dsmy/pen/ajKdx) by [dsmy](http://codepen.io/dsmy) on [CodePen](http://codepen.io/).
@dsmy
dsmy / Android-L-Ripple-Effect.markdown
Created August 8, 2014 02:22
A Pen by Dolphin Wood.

Responsive break out of parent element

Please comment :-)

Note! Because of the iframe on codepen this page might not show correctly unless in debug view.

A Pen by jakob-e on CodePen.

License.

@dsmy
dsmy / Instagram.markdown
Created August 8, 2014 02:24
A Pen by White Wolf Wizard.
// Custom Dashboard widgets
function custom_dashboard_widgets() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] );
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] );
<?php
// Define the 'Portfolio' post type. This is used to represent galleries
// of photos. This will be our top-level custom post type menu
$args = array(
'labels' => array(
'all_items' => 'Gallery',
'menu_name' => 'Portfolio',
'singular_name' => 'Gallery',
'edit_item' => 'Edit Gallery',
@dsmy
dsmy / my_custom_admin_columns.php
Created March 30, 2015 07:43
additional data in admin columns
// Display additional data in admin columns for testimonials section
function my_testimonials_columns($columns)
{
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => 'Title',
'testimonialType' => 'Testimonial Type',
'videoID' => 'Video ID',
'author' => 'Author',
'date' => 'Date',
@dsmy
dsmy / customwoocartclass.php
Created April 1, 2015 20:16
Custom Class if Item is in Cart Woocommerce
<?php
global $woocommerce;
// Extra post classes
$classes = array();
if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] )
$classes[] = 'first';
if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] )
$classes[] = 'last';
// If item is in cart add this class
foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {