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 | |
/* | |
©planet-green.com | |
*/ | |
function insert_json_ld_for_schema_org() | |
{ | |
if( !is_single() || !have_posts() ) { | |
return; | |
} |
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 | |
/* | |
* combine_thumb.php | |
* | |
* examples - http://planet-green.com/archives/446 | |
* | |
* System Requirements: | |
* PHP v5.3+ | |
* ImageMagick |
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
global $wpdb; | |
//次のSQLに SQL_CACHE を含めているのは、レンタルサーバーによってはMySQLのクエリキャッシュの | |
//デフォルト設定を無効にしているところがあるので、明示的にクエリキャッシュを有効にするように指定している。 | |
$sql = "SELECT SQL_CACHE DISTINCT posts.ID FROM {$wpdb->posts} posts"; | |
//チェックボックスorセレクトボックスの検索(複数のAND検索) | |
//例えばcolorというフィールド名だとする。 | |
//$_GET['color']にはカスタムフィールドの設定画面の選択肢の箇所で入力したラベルと値のうち、値の方が配列になって入ってくるとする。 |