Skip to content

Instantly share code, notes, and snippets.

View cheh's full-sized avatar

Dima Chekhovskyi cheh

View GitHub Profile
@cheh
cheh / gist:3852278
Last active October 3, 2019 15:39 — forked from ramzesimus/gist:3808207
CSS: Hide Text
.hide-text {
font: 0/0 a;
text-shadow: none;
color: transparent;
border: 0;
background-color: transparent;
}
@cheh
cheh / gist:6029161
Last active December 19, 2015 22:39 — forked from ramzesimus/gist:3956244
CSS: Text Gradient + Text Shadow
.title {
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #9bc7e2), color-stop(100%, #9bc7e2));
background-image: -webkit-linear-gradient(#ffffff,#9bc7e2);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: #fff;
position: relative;
text-shadow: none;
}
.title:before {
@cheh
cheh / wp-query-ref.php
Last active December 20, 2015 17:49 — forked from luetkemj/wp-query-ref.php
WP: WP_Query
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
<?php
function set_custom_dashicon() {
?>
<style type="text/css">
#menu-posts-{post_type} .wp-menu-image:before {
content: '\f174';
}
</style>
<?php
<?php
add_action( 'init', 'my_init' );
function my_init() {
register_post_type( 'book', array(
'public' => true,
'menu_icon' => 'dashicons-facebook',
) );
}
@cheh
cheh / plugin.php
Created January 22, 2014 12:09 — forked from kovshenin/plugin.php
<?php
/**
* Plugin Name: Hide Akismet
*/
add_filter( 'all_plugins', function( $plugins ) {
unset( $plugins['akismet/akismet.php'] );
return $plugins;
});
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@cheh
cheh / wrapping.php
Created March 5, 2014 09:33 — forked from scribu/wrapping.php
WP: Theme Wrapping method
<?php
# License: Public Domain
# I recommend replacing 'my_' with your own prefix.
function my_template_path() {
return My_Wrapping::$main_template;
}
jQuery(document).ready(function($){
var sidebarHeight = $("#sidebar").height();
var bodyHeight = ( $("#content").height() );
if (bodyHeight > sidebarHeight) {
$("#sidebar").css( 'min-height', bodyHeight + 85 );
};
});
<?php
/**
*
* Mobile theme switcher code - pulled from Mobile theme switch
* Original URI: http://wordpress.org/extend/plugins/mobile-theme-switcher/
* Original Author: Jonas Vorwerk, http://www.jonasvorwerk.com/
*
*
* Bypass this check in any browser by using http://myurl/?mobile=on or http://myurl/?mobile=off This is locally being stored using a cookie.