This file contains 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
<!DOCTYPE HTML> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<meta name="robots" content="noindex"> | |
<title>印刷用ページのベース(例)</title> | |
<link rel='stylesheet' id='print-css' href='<?php echo esc_url( get_template_directory_uri() ); ?>/print.css' type='text/css' media='all' /> | |
</head> | |
<body> |
This file contains 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 | |
//コピペするなら3行目から↓ | |
function mypace_custom_title( $title ){ | |
if( is_singular() ){ //タイトルタグカスタマイズの範囲を条件分岐で指定 | |
$post_id = get_the_ID(); //投稿IDを取得 | |
$my_title = get_post_meta( $post_id, 'my_title', true ); //カスタムフィールドの値を取得 | |
if( $my_title ){ //カスタムフィールドに値がある時 | |
return esc_html( $my_title ); //エスケープして出力 | |
} | |
} |
This file contains 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 | |
//コピペするなら3行目から↓ | |
function mypace_custom_title( $title ){ | |
if( is_singular() ){ //タイトルタグカスタマイズの範囲を条件分岐で指定 | |
$post_id = get_the_ID(); //投稿IDを取得 | |
$my_title = get_post_meta( $post_id, 'my_title', true ); //カスタムフィールドの値を取得 | |
if( $my_title ){ //カスタムフィールドに値がある時 | |
return esc_html( $my_title ); //エスケープして出力 | |
} | |
} |
This file contains 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 | |
//コピペするなら3行目から↓ | |
function mypace_custom_title_separator( $sep ){ | |
$sep = '|'; | |
return $sep; | |
} | |
add_filter( 'document_title_separator', 'mypace_custom_title_separator' ); //フィルターフックで処理を上書き |
This file contains 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 | |
//og:titleにサイト名を入れたいと言われた時用 | |
function custom_open_graph_title( $og_tags ) { | |
if( is_home() ){ | |
$og_tags['og:title'] = 'ブログ|' . get_bloginfo( 'name' ); | |
} elseif ( !is_front_page() ){ | |
$og_tags['og:title'] .= '|' . get_bloginfo( 'name' ); | |
} | |
return $og_tags; | |
} |
This file contains 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 | |
//コピペするなら3行目から↓ | |
function mypace_custom_title( $title ){ | |
if( is_singular() ){ //タイトルタグカスタマイズの範囲を条件分岐で指定 | |
$post_id = get_the_ID(); //投稿IDを取得 | |
$my_title = get_post_meta( $post_id, 'my_title', true ); //カスタムフィールドの値を取得 | |
if( $my_title ){ //カスタムフィールドに値がある時 | |
$title['title'] = esc_html( $my_title ); //ページタイトルの部分のみ上書き | |
return $title; | |
} |
This file contains 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: Private Debug Log | |
Description: Enable debug log to a private folder not accessible from the web | |
Version: 0.0.1 | |
Author: WebAware | |
Author URI: http://www.webaware.com.au/ | |
*/ | |
/* |
This file contains 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
#!/bin/sh | |
echo '玉子とじラーメン 730円(大盛900円)' | |
echo '玉子とじ担々麺 850円(大盛1030円)' | |
echo 'もやし麺 850円(大盛1030円)' | |
echo 'ワンタン麺 850円(大盛1030円)' | |
echo '叉焼麺 850円(大盛1030円)' | |
echo '天津麺 850円(大盛1030円)' | |
echo '五目麺 850円(大盛1030円)' | |
echo '替玉 180円' |
This file contains 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 | |
/** | |
* wp_list_categories の出力を支給HTMLに合わせて変更 | |
* カレント表示のclass変更、a要素の内側にさらにspanを入れる | |
* | |
* @param string $output | |
* | |
* @return string | |
*/ | |
function my_wp_list_categories( $output ) { |
NewerOlder