This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Wordpress Get The Widget | |
*/ | |
if( !function_exists('get_the_widget') ){ | |
function get_the_widget( $widget, $instance = '', $args = '' ){ | |
ob_start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) exit; | |
/** | |
* EDD DB base class | |
* | |
* @package EDD | |
* @subpackage Classes/EDD DB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('manage_posts_columns', function($columns) { | |
$columns['thumbnail'] = __('Post Thumbnail','leo'); | |
return $columns; | |
}); | |
add_action('manage_posts_custom_column', function($column, $id) { | |
if($column == 'thumbnail') { | |
the_post_thumbnail( array(50, 50) ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Amazon Rating Stars | |
*/ | |
function amazon_stars($asin) { | |
$content = file_get_contents('http://www.amazon.com/gp/customer-reviews/widgets/average-customer-review/popover/ref=dpx_acr_pop_?contextId=dpx&asin='.trim($asin)); | |
$result = preg_match('/([1,2,3,4,5]\.\d+) out of [1,2,3,4,5] stars/', $content, $matches); | |
$rating = $matches[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
videoResponsive: function() { | |
var vidHeight, | |
vidWidth; | |
function videoRatio() { | |
if(window.innerWidth < 768 ) { | |
vidWidth = window.innerWidth - 30; | |
vidHeight = Math.round(9 / 16 * vidWidth ); | |
}else if(window.innerWidth < 993 ) { | |
vidWidth = 720; | |
vidHeight = 405; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var navHeight = 0; //use valut for sticky menu height | |
$(document).on("scroll", onScroll); | |
$('#main-menu ul a[href*="#"]:not([href="#"]), #sidr a[href*="#"]:not([href="#"]').on('click', function (e) { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
e.preventDefault(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen and (max-width: 1100px) and (min-width: 981px) { /* content widht: 960px */ | |
} | |
@media only screen and (max-width: 980px) { /* content widht: 690px */ | |
} | |
@media only screen and (max-width: 767px) { /* content widht: 400px */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('admin_head', function(){ | |
global $typenow; | |
//only post type post and page | |
if(! in_array($typenow, array('post','page'))) { | |
return; | |
} | |
add_filter('mce_external_plugins', function( $plugin_array){ | |
$plugin_array['dummytext_plugin'] = plugins_url( '/js/tinymce-plugin.js', __FILE__ ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The core plugin class file | |
* | |
* Defines the functions necessary to register our custom taxonomies with | |
* WordPress. | |
* | |
* @link http://code.tutsplus.com/series/the-beginners-guide-to-wordpress-taxonomies--cms-706 | |
* @since 1.0.0 |