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 | |
/* | |
Plugin Name: Takien Mobile Version | |
Plugin URI: http://takien.com | |
Description: Automatically detects mobile useragent end redirect to mobile version. | |
Author: takien | |
Version: 0.1 | |
Author URI: http://takien.com/ | |
*/ |
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
/** | |
* Get YouTube ID from various YouTube URL | |
* @author: takien | |
* @url: http://takien.com | |
* For PHP YouTube parser, go here http://takien.com/864 | |
*/ | |
function YouTubeGetID(url){ | |
var ID = ''; | |
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/); |
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
/** | |
* WordPress Custom Rewrite Rule | |
* @author: takien | |
* @version: 1.0 | |
* @url: http://takien.com | |
*/ | |
function create_rewrite_rules() { | |
global $wp_rewrite; | |
$rewrite_tag = '%coba%'; |
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
/** | |
* Disable Featured image on Single Post | |
* @version: 1.0 | |
* @author: takien | |
* @url: http://takien.com | |
* Copy and paste this code in your theme's functions.php | |
*/ | |
add_filter('post_thumbnail_html','disable_single_featured'); | |
function disable_single_featured(){ |
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
/*static.js | |
* @author: takien | |
* @link: http://takien.com | |
* static element uses jQuery, no CSS required. | |
* Usage: add class 'element-static' to your element to make it static | |
*/ | |
jQuery(document).ready(function($){ | |
function element_static(scroll){ | |
$('.element-static').each(function() { |
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 | |
/* | |
* taxonomy orderby latest post | |
* add new arg for taxonomy (include category), | |
* orderby=latest_post | |
* @author: takien.com | |
* the original version by http://jeffry.net (only for category) | |
*/ | |
function filter_term_sort_by_latest_post_clauses( $pieces, $taxonomies, $args ) { | |
global $wpdb; |
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
/** | |
* Laod large image at last. | |
* requires jQuery | |
* @author: takien | |
*/ | |
jQuery(document).ready(function($){ | |
$('img').each(function(){ | |
var hires = $(this).data().src; | |
if((hires != undefined) && (hires != '')){ | |
$(this).attr('src',hires); |
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
test file 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
<?php | |
$perpage = 12; | |
$arg = Array( | |
'posts_per_page'=> $perpage, | |
'post_type'=>'product', | |
'paged'=> $paged | |
); | |
$query = new WP_Query($arg); | |
$numrows = $query->found_posts; | |
if($query->have_posts()) |
OlderNewer