http://shouken56.net/blog/practice/web/2301/
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="js/respond.src.js"></script> <!--[if lt IE 9]> <script src="js/html5shiv-printshiv.js"></script>//これはhtml5に対応させる <![endif]-->
http://shouken56.net/blog/practice/web/2301/
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="js/respond.src.js"></script> <!--[if lt IE 9]> <script src="js/html5shiv-printshiv.js"></script>//これはhtml5に対応させる <![endif]-->
doggstarmetro@yahoo.co.jp
doggstar111
kousukewatanabe398
ap1:
cf6aa279a186
http://apikey.wordpress.com/
http://wordpress.com/
ワードプレスフォーラム
Your username is: doggstar
Your password is: NUO$Pnor3oog
You can now log in: http://wordpress.org/support/
Enjoy!
この条件分岐タグは、現在の訪問者がログインしているかチェックします。これは TRUE または FALSE の値を返す boolean 関数です。
<?php if ( is_user_logged_in() ) { ... } ?>
<?php if ( is_user_logged_in() ):?>
<?php
if ( is_user_logged_in() ) {
echo 'Welcome, registered user!';
} else {
echo 'Welcome, visitor!';
};
?>
■ギャラリー
<?php
if ( have_posts () ) :
while ( have_posts() ) :
the_post();
?>
<!--ギャラリー取得--->
<?php
$fields = $cfs->get('shop_gallery');
foreach ($fields as $field) :
?>
<?php
$attachment_id = $field['gallery_photo'];
$sample_photo = wp_get_attachment_image($attachment_id,'full');
echo $sample_photo;
?>
<?php
endforeach;
?>
<?php
endwhile;
endif;
?>
ファンクションへ
オリジナル関数だと思う
//特定のカテゴリと特定のタグで絞った記事数の表示方法
function taxonomy_found_posts_num() {
$args = array(
'post_type' => array('shoku','asobu','share','seikatsu','iryou','manabu','koukyou','ofuroyado'), //カスタム投稿名
);
$my_query = new WP_Query($args);
return $my_query->found_posts;
}
//表示箇所に
//<?php echo taxonomy_found_posts_num('hokkaido','タグ1'); 件<br />
//<?php echo taxonomy_found_posts_num('aomori','タグ2'); 件
上記正式コード
<?php
function taxonomy_found_posts_num($cat_slug,$tag_slug) {
$args = array(
'post_type' =>'post',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => $cat_slug,
),
array(
'taxonomy' => 'post_tag',
'field' => 'slug',
'terms' => $tag_slug,
),
),
'posts_per_page' => 1
);
$my_query = new WP_Query($args);
return $my_query->found_posts;
}
?>
<?php
//特定のポストタイプと特定のユーザーIDで絞った記事数の表示方法
function taxonomy_found_posts_num1($post_type,$user_id) {
$args = array(
'post_type' => $post_type, //カスタム投稿名
'author' => $user_id,
);
$my_query = new WP_Query($args);
return $my_query->found_posts;
}
//ログインユーザーのIDを取得
$user = wp_get_current_user();
$user_idd = $user->get('ID')."\n"; // ID
//出力
echo taxonomy_found_posts_num1('shoku',$user_idd);
?>
日本語化 プラグ▶fields▶date▶jquery.datetime.js
変更
出力
単発
echo date('Y年m月d日', strtotime($cfs->get('birthday')));
ループ未検証
<?php $loop = new WP_Query(array("post_type" => "schedule", "posts_per_page" => 1 ));
while($loop->have_posts()): $loop->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2><?php the_title(); ?></h2>
<h3><?php echo $cfs->get('title'); ?></h3>
<ul>
<li><?php echo date('Y年m月d日', strtotime($cfs->get('date'))); ?></li>
<li><?php echo $cfs->get('summary'); ?></li>
</ul>
<?php $fields = $cfs->get('Schedule'); foreach ($fields as $field) { ?>
<h3><?php echo $field['title']; ?></h3>
<ul>
<li><?php echo date('Y年m月d日', strtotime($field['date'])); ?></li>
<li><?php echo $field['summary']; ?></li>
</ul>
<?php } ?>
</div>
<?php endwhile; ?>
参考
http://brushape.com/wordpress/%E3%80%90wordpress%E3%80%91%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%82%92%E7%B0%A1%E5%8D%98%E4%BD%9C%E6%88%90%E3%81%97%E3%81%9F%E3%81%8F%E3%81%A6%E3%80%8Ccu/
http://www.webopixel.net/javascript/195.html
<script type="text/javascript">
$(function() {
$('p').each(function(){
var txt = $(this).html();
$(this).html(
txt.replace('javascript','jQuery')
);
});
});
</script>
詳しくは参考ぺーじにほかのもあった
$post_ID = 10; //記事ID $post = get_post($post_ID); $title = get_the_title($post);
参考http://www.4web8.com/739.html