Skip to content

Instantly share code, notes, and snippets.

View tekapo's full-sized avatar

Tai / JOTAKI Taisuke tekapo

View GitHub Profile
@hissy
hissy / gist:4116825
Last active October 13, 2015 01:18
[WordPress] Override Loading Template
<?php
/**
* This is a example: force to use index.php at tag archive
*/
function my_template_include($template){
if ( is_tag() ) {
$template = get_index_template();
}
return $template;
}
@gatespace
gatespace / gist:4108710
Created November 19, 2012 02:52 — forked from tekapo/gist:4108697
最強のテンプレートタグ get_the_khoshino()
<?php
function get_the_khoshino($username == null) {
if (!empty($username)) {
return 'いやいや'.$username.'さんほどでは。';
} else {
return 'やはりですか。なるほどですね。';
}
}
?>
@wokamoto
wokamoto / replace-siteurl.php
Created September 4, 2012 23:22
WordPress のDB上のサイトURLを一気に変換
#!/usr/bin/php
<?php
switch($argc) {
case 1:
case 2:
echo "please input new site url and wp directory name!\n";
exit();
default:
$old_site = isset($argv[3]) ? $argv[3] : '';
$path = $argv[2];
@jonathonbyrdziak
jonathonbyrdziak / example.php
Created February 22, 2012 02:27
Wordpress Metabox, stand alone class for multiple metabox abilities
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created June 24, 2011 10:24
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/