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 | |
function custom_loginlogo() { | |
echo '<style type="text/css"> | |
.login h1 a {background-image: url('.wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'large', false )[0] | |
.') !important; | |
pointer-events: none; | |
background-size: contain; | |
height: 100px; | |
font-size: inherit; | |
width: auto; |
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 | |
function custom_rewrite_rule() { | |
$cat_base = ltrim(get_option('category_base'),'/').'/'; | |
$rewrites = Array( | |
$cat_base.'(.+?)/[^/]+/attachment/([^/]+)/?$'=>'index.php?attachment=$matches[1]', | |
$cat_base.'(.+?)/[^/]+/attachment/([^/]+)/trackback/?$'=>'index.php?attachment=$matches[1]&tb=1', | |
$cat_base.'(.+?)/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$'=>'index.php?attachment=$matches[1]&feed=$matches[2]', | |
$cat_base.'(.+?)/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$'=>'index.php?attachment=$matches[1]&feed=$matches[2]', | |
$cat_base.'(.+?)/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$'=>'index.php?attachment=$matches[1]&cpage=$matches[2]', | |
$cat_base.'(.+?)/[^/]+/attachment/([^/]+)/embed/?$'=>'index.php?attachment=$matches[1]&embed=true', |
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()) |
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
/** | |
* 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
<?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
/*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
/** | |
* 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
/** | |
* WordPress Custom Rewrite Rule | |
* @author: takien | |
* @version: 1.0 | |
* @url: http://takien.com | |
*/ | |
function create_rewrite_rules() { | |
global $wp_rewrite; | |
$rewrite_tag = '%coba%'; |
NewerOlder