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 | |
| /** | |
| * Disable comments feed link | |
| */ | |
| add_filter( 'feed_links_show_comments_feed', function() { return false; } ); | |
| /** | |
| * Disable comments feed | |
| */ | |
| function feed_force_404( $obj ) { |
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_the_khoshino($username == null) { | |
| if (!empty($username)) { | |
| return 'いやいや'.$username.'さんほどでは。'; | |
| } else { | |
| return 'やはりですか。なるほどですね。'; | |
| } | |
| } | |
| ?> |
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のテーマにおいて、テンプレート階層に基づきどのテンプレートファイルが使われているか書き出すコード。 | |
| ただし、header.php や get_template_part などでインクルードされているファイルを除く。 | |
| */ | |
| add_action('wp_footer', 'view_template_files'); | |
| if ( !function_exists( 'view_template_files' ) ): | |
| function view_template_files() { | |
| if ( defined('WP_DEBUG') && WP_DEBUG ) { | |
| global $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
| /* | |
| 使い方は投稿の編集画面内で | |
| [showcatposts cat="1" show="3"] | |
| とする。 | |
| */ | |
| function show_Cat_Posts_func($atts) { | |
| global $post; | |
| $output = ""; |
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
| /* | |
| * ショートコード [showbooks year="2012"] で投稿日を基準に当該年度の記事一覧を出したいという試み | |
| */ | |
| function filter_where( $where = "", $booknend ) { | |
| global $booknend; | |
| $eyear = $booknend + 1; | |
| $where .= " AND post_date >= '{$booknend}-04-01' AND post_date < '{$eyear}-04-01'"; | |
| return $where; | |
| } |
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
| function jp_wareki( $datenum ) { | |
| $wname = ""; | |
| $y = substr( $datenum, 0, 4 ); | |
| $m = substr( $datenum, 4, 2 ); | |
| $d = substr( $datenum, 6, 2 ); | |
| if ( checkdate($m, $d, $y) ) { | |
| if ( $datenum >= 20190501 ) { // 令和 | |
| $wname = "R"; | |
| $y -= 2018; |
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
| ja |
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
| server { | |
| # (略) | |
| location ~* /wp-login\.php|/wp-admin/((?!admin-ajax\.php).)*$ { | |
| index index.php index.html index.htm; | |
| # 許可するIPアドレスを記述 | |
| allow 192.168.0.1; | |
| deny all; | |
| # Basic認証のメッセージ |
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
| /* | |
| * [pc-only], [mobile-only] ショートコード(PCテーマ用) | |
| */ | |
| if ( ! function_exists( 'strip_block' ) ): | |
| function strip_block($attr, $content = null) { | |
| return ''; | |
| } | |
| endif; | |
| if ( ! function_exists( 'keep_block' ) ): |
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: My AdSense | |
| Description: add adsense to my blog | |
| Author: Takuro Hishikawa | |
| Version: 0.1 | |
| Author URI: http://notnil-creative.com/ | |
| */ | |
| // add adsbygoogle.js to footer |