http://www.faramoon.com/3015.html
http://www.webopixel.net/dreamweaver/197.html
これいみある?
http://www.faramoon.com/3015.html
http://www.webopixel.net/dreamweaver/197.html
これいみある?
/Applications/MAMP/conf/apache/にあるhttpd.confをテキストエディタなどで開いて、135行目ぐらいにある以下の部分を修正する。
AddType application/x-httpd-php .php .phtml
この部分にPHPを実行させたいファイル形式の拡張子を追加する。
AddType application/x-httpd-php .php .phtml .html
編集したhttpd.confを保存してMAMPを再起動すれば、追加したファイル形式でPHPが動くはず。
echo "<img src='img/s1.png' alt='管理人の評判星1個'/>\n";
<meta property="og:title" content="<?php
wp_title( '|', true, 'right' );
if(is_tax('genre')): //大カテゴリ21---------------------------------
$super = single_term_title('', false);
$args = array(
'posts_per_page' => 1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'midashi',//タクソノミー見出しの
'field' => 'slug',
'terms' => array( $super, '予備' ),//タームに現在のタームを入れるsuper※条件midashiとgenreのターム名は同じ
//'operator'=>'NOT IN'
),
),
'post_type' => 'd_midashi_top', //カスタムポスト見出しトップの
);
query_posts( $args );
if ( have_posts () ) :
while ( have_posts() ) :
the_post();
echo get_post_meta($post->ID,"見出し文",true);
endwhile;
endif;
//genreのタクソノミーだったら終わり
?><?php
endif; //else:
wp_reset_query();
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
if(is_singular( 'performer' ) )://パフォーマー個---------------------------------
echo get_post_meta($post->ID,"キャッチコピー",true);
echo ' ';
endif;
if(is_tax('chiiki')): //パフォーマー地域---------------------------------
echo 'イベントレポート ';
endif;
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
if(is_page()): //固定ページ--------------------------------
echo " | $site_description";
endif;
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
?>" />
<?php if(is_home()): //ホームなら?> <meta property="og:type" content="website"> <?php else: ?> <meta property="og:type" content="article"> <?php endif; ?>
<?php if(is_singular( 'performer' ) )://パフォーマー個人---------------------------------?>
<meta property="og:description" content="<?php echo mb_substr( str_replace(array("\r\n","\r","\n"),'',strip_tags(get_post_meta($post->ID,"プロフィール",true))), 0, 120); //ソースを改行させない カスタムフィールドの文字を指定数だけ入れる?>">
<?php elseif(is_singular( 'event_report' ) )://レポート個---------------------------------?>
<meta property="og:description" content="<?php echo mb_substr( str_replace(array("\r\n","\r","\n"),'',strip_tags($post->post_content)), 0, 120 ); //ソースを改行させない コンテンツの文字を指定数だけ入れる?>">
<?php else: ?>
<meta property="og:description" content="大道芸人、マジシャン、似顔絵師、演奏家などの出張派遣、様々なパフォーマーを派遣いたします。全国の芸人が総勢250名以上在籍!イベント企画会社様から個人のイベントまで、驚きの低価格にて派遣いたします。" />
<?php endif; ?>
<?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でしょ?
<?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; ?>
<?php
if ( have_posts () ) :
while (have_posts()) : the_post(); $counter++;
?>
<?php include("d_roop_box.php") ?>
<?php if ($counter <= 1) {
include("d_ad_1_2.php");
} ?>
<!----閉じループタグ----->
<?php
endwhile;
endif;
?>
<!---------------リセットクエリ--------------------------------------------->
<?php wp_reset_query(); ?>
//タイトルを入力してくださいを変える
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');
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;
} ?>
//複数サイドバーを使える register_sidebars(5, array()); 指定の場所に <?php dynamic_sidebar();?>
<?php the_tags('タグ: ',' > '); ?>
参考
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/the_tags
<?php echo mb_substr(get_the_excerpt(),0, 240);?><br /> <div class="alignright a_color" style="font-size:14px;"><a href="<?php the_permalink();?>">全文▶</a></div>
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' );
http://kachibito.net/wordpress/youtube-tips.html
<?php if(get_post_meta($post->ID, 'YTid', true)): ?> <iframe width="649" height="395" src="http://www.youtube.com/embed/<?php echo get_post_meta($post->ID, 'YTid', true); ?>?rel=0" frameborder="0" allowfullscreen></iframe> <?php endif; ?>
$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>';
‘
‘.
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>