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 Request = require('request'); | |
var Moment = require('moment'); | |
var FeedParser = require('feedparser') | |
// config | |
var username = process.argv[2]; | |
var baseUrl = 'http://b.hatena.ne.jp/' + username + '/'; | |
var rssUrl = 'rss'; | |
var baseYear = parseInt(process.argv[3]); |
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 print_my_scripts(){ | |
if( !is_admin() ){ | |
wp_enqueue_script( 'script', get_stylesheet_directory_uri() . '/shared/js/script.js' ); | |
} | |
} | |
add_action( 'wp_footer', 'print_my_scripts' ); |
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 load_cdn() { | |
if ( !is_admin() ) { | |
wp_deregister_script( 'jquery' ); | |
wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', 'jquery' ); | |
} | |
} | |
add_action( 'init', 'load_cdn' ); |
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
<title><?php echo( wp_title( ' | ', true, 'right' ) ); bloginfo( 'name' );?></title> |
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_query( $wp_query ){ | |
if( !is_admin() && $wp_query->is_main_query() && $wp_query->is_post_type_archive( 'title' ) ){ | |
$wp_query->set( 'posts_per_page', 12 ); | |
} | |
} | |
add_filter( 'pre_get_posts', 'custom_query' ); |
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 get_post_by_slug( $post_name, $post_type = 'post' ){ | |
$args = array( | |
'name' => $post_name, | |
'post_type' => $post_type, | |
'posts_per_page' => 1 | |
); | |
$the_post = get_posts( $args ); | |
$the_post = $the_post[0]; |
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 change_default_template( $template ){ | |
if( is_author() ){ | |
$template = get_home_template(); | |
} | |
return $template; | |
} | |
add_filter( 'template_include', 'change_default_template' ); |
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 get_option_datetime_format(){ | |
$date_format = get_option( 'date_format' ); | |
$time_format = get_option( 'time_format' ); | |
$format = $date_format . ' ' . $time_format; | |
return $format; | |
} |
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
$.each(object, function(index, value) { | |
console.log(value); | |
}); |
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( 'template_include', 'template_debug' ); | |
function template_debug( $template ){ | |
var_dump( $template ); | |
exit; | |
} |
NewerOlder