if ( have_posts() ) : // Start the Loop. echo '<div class="archive-header archive-title" style="margin-bottom:0px;">新着記事</div>'; while ( have_posts() ) : the_post();
追加
if ( have_posts() ) : // Start the Loop. echo '<div class="archive-header archive-title" style="margin-bottom:0px;">新着記事</div>'; while ( have_posts() ) : the_post();
追加
//特定の条件でボディにクラスをつける
add_filter('body_class','my_class_names');
function my_class_names($classes) {
if(is_page( '62' )){
// add 'class-name' to the $classes array
$classes[] = 'list-view';
// return the $classes array
}
return $classes;
}
http://memocarilog.info/wordpress/theme-custom/3001 参考
これで固定ページのクエリポストにも
list-viewをつけて
アーカイブぺーじのtw14のcssを
<?php
/**
* The template for displaying Category pages
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
get_header(); ?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php //カテゴリ:ライブスケジュールの場合 未来の記事しか出さないよ
if(in_category(4)):
function filter_where($where = '') {
$where .= " AND post_date > '" . date('Y-m-d', strtotime('0 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
?>
<?php //カテゴリ:ライブスケジュールの場合セットしないといけないよ カテゴリアーカイブではなくなるので下記single_cat_titleはつかえなくなるよ!
query_posts(
array(
'paged' => $paged,
'cat'=> array(4),
'order' => ASC,
));
?>
<?php endif; //カテゴリ:ライブスケジュールの場合★おわり ?>
<?php if ( have_posts() ) : //記事があれば
if(in_category(4))://カテゴリ:ライブスケジュールの場合?>
<header class="archive-header">
<h1 class="archive-title">一覧</h1>
<?php else://カテゴリ:他の場合?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( ' %s', 'twentyfourteen' ), single_cat_title( '', false ) ); ?> 一覧</h1>
<?php endif; //カテゴリ:ライブスケジュールの場合★おわり ?>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>
</header><!-- .archive-header -->
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
endwhile;
// Previous/next page navigation.
twentyfourteen_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part( 'content', 'none' );
endif;
?>
</div><!-- #content -->
</section><!-- #primary -->
<?php
get_sidebar( 'content' );
get_sidebar();
get_footer();
まずcssで改造
スタイルに追加
/*サイドと上色替え*/
.site:before,.site-header{
background-color: #72DFB8!important;
}
/*アドミンバー色替え*/
.search-toggle,#wpadminbar{
background-color: #FFA70A!important;
}
/*サムネイル ホバー色替え*/
.post-thumbnail{
background-color: #B2B440!important;
}
/*サムネイル 401までマージン*/
@media screen and (min-width: 401px) {
.entry-header .post-thumbnail{margin-bottom:10px;}
}
/*サイドメニュー ヘッダーメニューのカレントカラー*/
.site-navigation .current_page_item > a, .site-navigation .current_page_ancestor > a, .site-navigation .current-menu-item > a, .site-navigation .current-menu-ancestor > a {
color: #FFA70A!important;
}
/*サイドメニュー ヘッダーメニューのホバー上記かれんとよりあとに*/
.site-navigation a:hover {
background-color: #FFA70A!important;
color: #FFFFFF!important;
}
/*シングル 他Pageのぞく ポストサムネイルをエントリーヘッダーに入れたからマージンはいらない*/
.single.full-width.singular .site-content .hentry.has-post-thumbnail,
.full-width .site-content .has-post-thumbnail .entry-header
{
margin-top: 0px!important;
}
3188行目あたり
多分.has-post-thumbnailけした
.list-view .site-content .hentry {
border-top: 1px solid rgba(0, 0, 0, 0.1);
padding-top: 48px;
}
.list-view .site-content .hentry:first-of-type,
/*.list-view .site-content .hentry.has-post-thumbnail*/
/*サムネイル有りも線いるし 一個目はいらない*/
.list-view .site-content .hentry.has-post-thumbnail:first-of-type{
border-top: 0;
padding-top: 0;
}
'. get_the_time('Y年m月d日'). '
' . コード . '
出力では無く 取得 上記は出力前提のため出力される たとえば エコーとか野中
get_the_time('Y年m月d日')
大きいサイズを出したいなら 横長の写真ならOK
正方形を出したいなら 300pxにしとけ
タイトルにタイトル
ディスプリクションにディスプリクション or コンテンツ本文
ぐらいか
iframe {
z-index: 1000!important;
}
こうしたらなおりました。
カスタムポストの新着情報
<h3 class="widgettitle">施工例 NEW !!</h3>
<?php
$args = array(
'posts_per_page' => 3,
'post_type' => 'jirei_new', //カスタム投稿名
);
?>
<?php
query_posts( $args );
if ( have_posts () ) :
while ( have_posts() ) :
the_post();
?>
<div class="popular_one">
<div class="popular_sam">
<?php
$i = 0;
$kiji = 1;//この回数でフォーチ終わる。
$fields = $cfs->get('jirei_imgs');
foreach ($fields as $field) :
if($i >= $kiji)://siが3よりおおきくなったら
break;//ループおわり
else://それまではこれで出力
?>
<?php
$title= get_the_title();
$attachment_id = $field['jirei_img'];
$sample_photo = wp_get_attachment_image($attachment_id,'jirei_small',0,array('alt'=>$title,'title'=>$title));?>
<a href="<?php the_permalink(); ?>">
<?php
echo $sample_photo;
?>
</a>
<?php
$i++;//多分繰り返すごとに$iに数値が1つづ増える
endif;
endforeach;
?>
</div>
<h4><div class="popular_title"><a href="<?php the_permalink(); ?>">
<?php the_title(); ?></a></div></h4>
<div class="popular_date" style="padding-top:5px;">
<p><?php get_trim_str(array('str'=>get_post_meta($post->ID,"jirei_disp",true), 'len'=>100)); ?></p>
</div>
</div>
<?php
endwhile;
endif;
?>
<!-----------------リセットクエリ--------->
<?php wp_reset_query(); ?>
新着ブログ
<h3 class="widgettitle">新着ブログ</h3>
<?php
$args = array(
'posts_per_page' => 3,
'cat' => 4,
);
?>
<?php
query_posts( $args );
if ( have_posts () ) :
while ( have_posts() ) :
the_post();
?>
<div class="popular_one">
<div class="popular_sam"><a href="<?php the_permalink(); ?>">
<?php
$title= get_the_title();
the_post_thumbnail('side_new_post_sam',
array('class' => 'blog_sam_img','alt' =>$title, 'title' => $title)
); ?>
</a></div>
<div class="popular_date"><?php the_time('Y/m/d'); ?></div>
<div class="popular_title"><p><a href="<?php the_permalink(); ?>">
<?php the_title(); ?></a></p></div>
</div>
<?php
endwhile;
endif;
?>
<!-----------------リセットクエリ--------->
<?php wp_reset_query(); ?>
新着 サムネイルなし
<h3 class="widgettitle">Information</h3>
<?php
$args = array(
'posts_per_page' => 3,
'cat' => 5,
);
?>
<?php
query_posts( $args );
if ( have_posts () ) :
while ( have_posts() ) :
the_post();
?>
<div class="popular_one">
<div class="popular_sam"><a href="<?php the_permalink(); ?>">
<?php
$title= get_the_title();
the_post_thumbnail('side_new_post_sam',
array('class' => 'blog_sam_img','alt' =>$title, 'title' => $title)
); ?>
</a></div>
<div class="popular_date"><?php the_time('Y/m/d'); ?></div>
<div class="popular_title"><p><a href="<?php the_permalink(); ?>">
<?php the_title(); ?></a></p></div>
</div>
<?php
endwhile;
endif;
?>
<!-----------------リセットクエリ--------->
<?php wp_reset_query(); ?>
css
/*-----------------------------------------------------ウィジェット用-----------------------------------------------------*/
.widgettitle{
font-size: 12px;
margin-top: 20px;
margin-bottom: 30px;
line-height: 44px;
height: 40px;
background-color: #595959;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
color: #FFF;
padding-left: 15px;
border-left-width: 4px;
border-left-style: solid;
border-left-color: #e50012;
}
.widget{
list-style-type: none;
}
/*-----------------------------------------------------wp popular postプラグイン用-----------------------------------------------------*/
.popular-posts{}
.popular_one{
margin-bottom: 8px;
padding-bottom: 8px;
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #CCC;
clear: both;
overflow: hidden;
}
.popular_sam{
float: left;
}
.popular_sam img{
float: left;
background-color: #FFF;
padding: 1px;
border: 1px solid #CCC;
margin-right: 12px;
}
.popular_date{
font-size: 10px;
}
.popular_title{
font-size: 12px;
}
.wpp-views{
color: #FF7737;
}
ポスト関連記事 出力コード
<?php related_posts(); ?>
css
/*-----------------------------------------------------YARPPプラグイン用-----------------------------------------------------*/
.related-post{
height:100%;
}
.related-post{
width:100%;
overflow:hidden;
margin-top:5px;
}
.related-entry {
vertical-align: top;
float: left;
width:123px;
font-size: 13px;
min-height: 210px;
margin-bottom:0px;
padding: 0px 10px 0px 10px;
display: block;
}
.related-entry img{
padding: 4px;
border: #ccc 1px solid;
width: 123px;
height: 123px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 5px;
margin-left: 0px;
}
#post-syokai2{
border-left: 10px solid #999;
padding: 1px 9px;
margin: 5px 0 16px 0;
font-size: 16px;
margin-left: 5px;
}
.kannrenn h3{
background-color: #c1c1ff;
font-size: 14px;
color: #494a41;
margin: 35px 0 10px 0;
padding: 5px 0px 5px 20px;
}
.kannrenn ul{
list-style-type: none;
}
.kannrenn ul li{
float: left;
width: 100px;
line-height: 21px;
margin: 0 13px 0 0;
}
yarpp-template-d1.php
<?php if(have_posts()):?>
<div style="padding-top:0px;"></div>
<h2 id="post-syokai2">関連記事はこちら</h2>
<div class="related-post">
<?php while(have_posts()) : the_post(); ?>
<?php if(has_post_thumbnail()):?>
<h3><div class="related-entry"><a href="<?php the_permalink() ?>"rel="bookmark"title="<?php the_title_attribute(); ?>"><?php $title= get_the_title(); the_post_thumbnail("thumbnail",array( 'alt' =>$title)); ?><?php the_title(); ?></a></div>
<?php else: ?>
<div class="related-entry"><a href="<?php the_permalink() ?>"rel="bookmark"title="<?php the_title_attribute(); ?>">
<img src="<?php echo home_url(); ?>/wp-content/plugins/wordpress-popular-posts/no_thumb.jpg" alt="<?php $title= get_the_title(); echo $title ?>" />
<?php the_title(); ?></a></div></h3>
<?php endif; ?>
<?php endwhile; ?>
</div>
<?php else: ?>
<?php endif; ?>
http://onsenjapan.jp/
ここのようなやつをつくる
http://wordpress.org/plugins/geo-mashup/
こいつ
日本語説明
http://nuts-bee.com/blog/wd/geo-mashup-wordpress%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3/
http://banana100.com/blog/archives/91
http://g.azucar.jp/archives/1259
カスタムマーカーを使う場合はGeo Mashup Custom pluginをインストール?
Auto Post Thumbnail Android 不具合
バージョンあっぷすべし
携帯でアップした画像なのか
サムネイルが表示されなくなった
3.8にあっぷしたら
http://yuhnote.com/2012/06/15/wp3_4-eyecatch-thumbnail/
こちらと同じく。
8番は大丈夫だったからアプリが原因
メディアからサムネイルが消えているのを選び 消して サムネイルを再度作成
これでよし
http://goldsource.sakura.ne.jp/symlink/index.cgi
CGI
ほんけ
http://web-sozai.seesaa.net/category/5905157-1.html
テラタームなどで変える
シンボリックリンク
ln -s /home/goldsource/www/fiorealbergo/js /home/goldsource/www/fiorealbergo/wp/js
ln -s /home/goldsource/www/fiorealbergo/img /home/goldsource/www/fiorealbergo/wp/img
これやるとパーマーリンク変えれん?
その他ポイント
%ln -s /home/goldsource/www/D-marking /home/goldsource/www/D-marking/wordpress/wp-content/themes/dshort
%までコピーしない
lnの後にスペース
ln -s /home/goldsource/www/fiorealbergo/js /home/goldsource/www/fiorealbergo/wp/js
PCではアプリケーション SymbolicLinker.serviceを起動 右クリック マック
htaccess
AddHandler php5.2-script html
ろーかるではきかない
galleria-1.3.3に変えたらバグがなくなった
http://shirose.jp/2013/08/itunes-affiliate-phg/
ここに解りやすく。
ツールから作成
/*点滅スクリプトと同時使用*/
@-webkit-keyframes pulse {
from {
opacity: 1.0;/*透明度100%*/
}
to {
opacity: 0.1;/*透明度80%*/
}
}
#d_sidenavi_in ul.side_main_navi li a:hover {
-webkit-animation-name: pulse;/* 実行する名前 */
-webkit-animation-duration: 0.1s;/* 0.3秒かけて実行 */
-webkit-animation-iteration-count: 3;/* 何回実行するか。infiniteで無限 */
-webkit-animation-timing-function: ease-in-out;/* イーズインアウト */
-webkit-animation-direction: alternate;/* alternateにするとアニメーションが反復 */
-webkit-animation-delay: 0s; /* 実行までの待ち時間 */}
RedirectMatch 301 .* http://example.com/index.html
これがどこにアクセスしてもここに飛ぶ 全部トップページへ飛ばす。
301が検索エンジンにも引越報告
以下例 その他
サーバー移転などサイト全体のリダイレクト
現在のサーバーURL(転送元) http://www.example.jp/
新しいサーバーURL(転送先) http://example.com/
Redirect permanent / http://example.com/
ディレクトリ単位のリダイレクト(転送)
現在のサーバーURL(転送元) http://www.example.jp/shop/
新しいサーバーURL(転送先) http://example.com/japan/shopping/
Redirect permanent /shop/ http://example.com/japan/shopping/
特定ファイル(拡張子)のみリダイレクト(転送)
現在のサーバーURL(転送元) http://www.example.jp/
新しいサーバーURL(転送先) http://example.com/
RedirectMatch 301 (.*)\.jpg$ http://example.com$1.jpg
RedirectMatch 301 (.*)\.gif$ http://example.com$1.gif
■コンタクトフォームでのスパム対策 直埋め込み
acceptance-0 送信してよろしいですか?
と認証式にするとよい
http://curious-everything.com/1089-entry.html
ショートコード埋め込み
<?php echo do_shortcode( '[contact-form-7 id="4" title="コンタクトフォーム 1"]' ); ?>
■コンタクトフォームで添付ファイルの最初は1MB
変更は
[file file-359 limit:3000000]
■コンタクトフォーム ファイル名文字化け
やったけど入換え phpmailなんとか
治らなかった
<script> image = new Image(); image.src = "img/top/jc_top2-02.jpg"; image.src = "img/top/jc_top2-07.jpg"; image.src = "img/top/jc_top2-06.jpg"; image.src = "img/menu_put-01_on.jpg"; image.src = "img/menu_put-02_on.jpg"; image.src = "img/menu_put-03_on.jpg"; image.src = "img/menu_put-04_on.jpg"; image.src = "img/menu_put-05_on.jpg"; image.src = "img/top/jc_top2-02.jpg"; </script> </head>