Custom Field GUI Utility Extenderで表示した画像をog:imgに

<?php if(is_singular( 'event_report' )): //シングルより先に読み込む?>
<meta property="og:image" content="<?php $imagefield = get_imagefield('レポート画像1');
$attachment = get_attachment_object($imagefield['id']);
$imgattr = wp_get_attachment_image_src($imagefield['id'], 'thumbnail'); // thumbnail, large, medium, full を指定
print $imgattr[0]; 
?>" />

<?php elseif(is_singular( 'performer' )): ?>
<meta property="og:image" content="<?php $imagefield = get_imagefield('パフォーマー画像1');
$attachment = get_attachment_object($imagefield['id']);
$imgattr = wp_get_attachment_image_src($imagefield['id'], 'thumbnail'); // thumbnail, large, medium, full を指定
print $imgattr[0]; 
?>" />
<!--それ以外なら-->





<?php else: ?>




<meta property="og:image" content="http://www.xn--q9js4nqcxfya8d9mb5974lbbyb.com/img/face.jpg" />
<?php endif; ?>

thumbnailでええの?fullでしょ?

Custom Field GUI Utility Extender 画像出力

  <?php if(get_post_meta($post->ID, 'パフォーマー画像1', true)): ?> 
    <!--サムネイルコード-->       
<?php
$imagefield = get_imagefield('パフォーマー画像1');
$attachment = get_attachment_object($imagefield['id']);
$imgattr = wp_get_attachment_image_src($imagefield['id'], 'thumbnail'); // thumbnail, large, medium, full を指定
echo '<image src="' . $imgattr[0] . '" width="' . $imgattr[1] . '" height="' . $imgattr[2] . '" alt="' . get_the_title() . '" title="' . get_the_title() . '" />';
?>
<!--サムネイルコード--> 
 <?php endif; ?>

タイトルを入力してくださいを変える

//タイトルを入力してくださいを変える
function change_default_title( $title ) {
	$screen = get_current_screen();
	if ( 'performer' == $screen->post_type ) {
		$title = 'パフォーマー名を入力してください。';
	} else if ( $screen -> post_type == 'post' ) {
		$title = 'これは投稿だけ変更します';
	}
	return $title;
}
add_filter('enter_title_here', 'change_default_title');

1 件目と2 件目の記事の間に広告を挿入する

http://nanokamo.com/articles/web-service/wordpress/wordpress-top-ad.html

<?php

if ( have_posts () ) :
while (have_posts()) : the_post(); $counter++;
?>        
 
<?php include("d_roop.php") ?>


<?php if ($counter <= 1) {
print <<<EOD
アドセンスのコードを挿入
EOD;
} ?>



<!----閉じループタグ----->
<?php
    endwhile;
endif;
?>
<!---------------リセットクエリ--------------------------------------------->
<?php wp_reset_query(); ?>

よくわからんが
モバイル用

            while ( have_posts() ) : the_post(); $counter++;
                $i++;
        ?>

<?php if ($counter == 3) {
print <<<EOD
<div class="hentry">アドセンスのコード</div>
EOD;
} ?>

マニュアル設置覚え

wp-admin/imgに画像
Dにtori.php

ファンクションに

//管理メニュー追加
function test_menu_page() {
    $siteurl = get_option( 'siteurl' );
?>
<div class="wrap">
    <h2>マニュアル</h2>
<?php include("tori.php"); ?>
   </div>
<?php
}
function test_admin_menu() {
    add_menu_page( 'マニュアル', 'マニュアル', 'read',
		   __FILE__, 'test_menu_page' );
}
add_action( 'admin_menu', 'test_admin_menu' );

VK Post Author Display改造 ポストオーサープラグイン

$profileUnit =
				'<h4>'.$author_box_title.'</h4>'.
				'<div id="avatar">'.get_avatar( get_the_author_meta('email'), 80 ).'</div>'.
				'<dl id="profileTxtSet">'.
				'<dt>'.'<span id="authorName">'.get_the_author_meta( 'display_name' ).'</span>';
			if(isset($caption)):

$profileUnit =
				'<h4>'.$author_box_title.'</h4>'.
				'<div id="avatar">'.get_avatar(get_the_author_id(), 80).'</div>'.
				'<dl id="profileTxtSet">'.
				'<dt>'.'<span id="authorName">'.get_the_author_meta( 'display_name' ).'</span>';

‘.echo get_avatar(get_the_author_id(), 80).’

‘.

php the_time 投稿時間

http://webway.seesaa.net/article/128282171.html

'Y年m月d日(D)' ⇒ 2009年09月09日(木)

'Y/m/d' ⇒ 2009/09/09

'Y年n月j日(D)' ⇒ 2009年9月9日(木)

'Y/n/j' ⇒ 2009/9/9

'Y年m月d日(D)h時i分s秒' 
⇒ 2009年09月09日(木)09時09分09秒

'Y/m/d h:i:s' ⇒ 2009/09/09 09:09:09

タグをリンク付きでリスト表示 さらにカレント

<ul> 
           <li>タグ</li>
         <?php
$tagList = $wpdb->get_results($wpdb->prepare("
    SELECT t.term_id,t.name,t.slug,tt.count
    FROM $wpdb->terms AS t
    JOIN $wpdb->term_taxonomy AS tt
    USING(term_id)
    WHERE tt.taxonomy = 'post_tag'
    ORDER BY tt.count DESC
",null));
foreach ($tagList as $value):?>
<?php
$add_style = '';
$add_class = '';
if( is_tag( $value ) ){
	$add_class = 'current';
	$add_style = 'style="color:#71B6FC;"';
}
?>

<li>
<a href="/?tag=<?php echo $value->slug; ?>/" <?php echo $add_style;?> class="<?php echo $add_class;?>">
<?php echo $value->name; ?></a> 
(<?php echo $value->count; ?>)</li>
<?php endforeach;?>
         </ul>

参考http://ja.forums.wordpress.org/topic/12295
このままでは駄目だった

タグをリンク付きでリスト表示

<ul> 
           <li>タグ</li>
         <?php
$tagList = $wpdb->get_results($wpdb->prepare("
    SELECT t.term_id,t.name,t.slug,tt.count
    FROM $wpdb->terms AS t
    JOIN $wpdb->term_taxonomy AS tt
    USING(term_id)
    WHERE tt.taxonomy = 'post_tag'
    ORDER BY tt.count DESC
"));
foreach ($tagList as $value):?>
<li>
<a href="/?tag=<?php echo $value->slug; ?>/">
<?php echo $value->name; ?></a> 
(<?php echo $value->count; ?>)</li>
<?php endforeach;?>
         </ul>

カテゴリーアーカイブだったら

<?php if(is_category()): ?>

<?php endif; ?>



<?php if(is_category('9')): ?>
カテゴリーIDが"9"の記事を表示します。
<?php elseif(is_category('Stinky Cheeses')): ?>
	カテゴリーの名前が"Stinky Cheeses"の記事を表示します。
<?php elseif(is_category('blue-cheese')): ?>
	カテゴリースラッグが"blue-cheese"の記事を表示します。
<?php elseif(in_category( array( 1,2,3 ) )): ?>
	カテゴリーIDが "1, 2, 3 "の記事を表示します。
<?php elseif(!in_category( array( 4,5,6 ) )): ?>
	カテゴリーIDが" 4, 5, 6 "意外の記事を表示します。
<?php endif; ?>


編集中 絞り込み検索

<form action="<?php echo home_url(); ?>" method="get">
    <ul>
        <li><?php wp_dropdown_categories(array(
		'taxonomy' =>  'chiiki2',
            'show_option_all' => 'すべてのカテゴリーを含む'
        )); ?></li>
        <li><select name="tag">
            <option value="">タグを選択</option>
            <?php
            $tags = get_tags();
            foreach ($tags as $tag): ?>
                <option value="<?php echo esc_attr($tag->slug); ?>"><?php echo esc_html($tag->name); ?></option>
            <?php endforeach; ?>
        </select></li>
       <li> キーワード:<input type="text" value="" name="s" /></li>
   </ul>
   <input type="submit" value="この内容で検索!" />
</form>

http://mypacecreator.net/blog/archives/1807

http://wpdocs.sourceforge.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/wp_dropdown_categories
↑よりさらに詳しく

階層を維持

'hierarchical' => '1',

search.phpでユーザー名とか、タグ名・カテゴリ名も検索対象その2

https://gist.github.com/wokamoto/3486944

ファンンクションにこれを追加

function custom_search($search, $wp_query) {
	global $wpdb;
 
	//サーチページ以外だったら終了
	if (!$wp_query->is_search)
		return $search;
	if (!isset($wp_query->query_vars))
		return $search;
 
	// ユーザー名とか、タグ名・カテゴリ名も検索対象に
	$search_words = explode(' ', isset($wp_query->query_vars['s']) ? $wp_query->query_vars['s'] : '');
	if ( count($search_words) > 0 ) {
		$search = '';
		foreach ( $search_words as $word ) {
			if ( !empty($word) ) {
				$search_word = $wpdb->escape("%{$word}%");
				$search .= " AND (
 {$wpdb->posts}.post_title LIKE '{$search_word}'
 OR {$wpdb->posts}.post_content LIKE '{$search_word}'
 OR {$wpdb->posts}.post_author IN (
   SELECT distinct ID
   FROM {$wpdb->users}
   WHERE display_name LIKE '{$search_word}'
   )
 OR {$wpdb->posts}.ID IN (
   SELECT distinct r.object_id
   FROM {$wpdb->term_relationships} AS r
   INNER JOIN {$wpdb->term_taxonomy} AS tt ON r.term_taxonomy_id = tt.term_taxonomy_id
   INNER JOIN {$wpdb->terms} AS t ON tt.term_id = t.term_id
   WHERE t.name LIKE '{$search_word}'
     OR t.slug LIKE '{$search_word}'
     OR tt.description LIKE '{$search_word}'
   )
) ";
			}
		}
	}
 
	return $search;
}
add_filter('posts_search','custom_search', 10, 2);