fumiyasac
フォーラムへの返信
-
フォーラム: 使い方全般
返信が含まれるトピック: カスタム投稿タイプ表示用のテンプレートを作成したのに、なぜかindex.php>jim912さん
ご指摘ありがとうございました!
重複をPORTFOLIOページのURLとさせないようにしたら上手くいきました!
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングmizube様
こちらこそすいませんでした。
>Default テーマを適用した場合、2ページ目以降は正しく表示されますか?
変更していたところ、正しく動いていましたので、プログラムは正しかったです。しかし、階層がおかしかった(categoryがないままページングを行おうとしていたので、404になっていた。categoryを消そうとしてプラグインを入れましたが、今度は別の部分のページングに問題が発生したのでcategoryは表示したままにしました。)為にプログラムは正しいのにうまくページングがされていなかったという結論でした。
ここまで丁寧に付き合って下さいまして、本当に感謝しております。
shokun0803様、LVP8様も、私のこのような下らなく、また稚拙極まる質問にお答えいただいて本当に感謝しております。
自分のスキルのなさに歯がゆさを覚えると同時に、ご回答下さいました皆様には数々の非礼をお詫び申し上げます。
この一件を教訓に、これからも少しずつではありますが、精進していきますのでよろしくお願い申し上げます。
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングmizube様
追記になります。
もしかするとhtaccessの問題なのかも?とも思いました。
ページ送りをクリックすると、以下のようなURLになるからかな?とふと思いました。
http://www.example.name/category/categoryname/page/2/それで、挙動的にはなんら問題がないのにはじかれるのかなと思いました。
すいません。ちょっと思い当たるフシがあったので補足しました。
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングmizube様
時間帯の件了解しました。もし、ブログの中を見たいというご要望でもご対応いたします。
また何か分かりましたらご連絡いたします。
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングmizube様
サンプルコードを提示して頂きまして、本当にありがとうございます。
少し希望の光が見えてきました!
頂きましたコードをindex.phpにコピーして入れてみましたが、ページング部分をクリックすると「これはカテゴリー別ページではありません。」が表示されてしまいました。
もしかして、index.phpに書いているからかなと分析している感じですが…もしかして今回頂いたものは、archive.phpに書かないといけないものだったのでしょうか?
補足になるんですが、パーマリンク設定は以下のようになっています。
(カスタムのもの)/%category%/%post_id%/こちらも冷静になってもうすこし触ってみます!
toppage.phpに関しては、以下のような動きです。
Webサイト全体のTOPです。特定カテゴリーの記事を5件表示するようにしてあります。カテゴリに属する記事の一覧はindex.phpを使用しています。(カテゴリー別アーカイブのテンプレートは用意していません。作り方がわからなかったもので・・・)
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングshokun0803様
ご指摘ありがとうございました。どうやら、コピペの際にタグなどが消えてしまったようでした。
こちらの件に関しては大変申し訳なく思っております。
あわてまくって、冷静になれない点、反省します。
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングありがとうございます。
query_postの問題含め、in_categoryをis_categoryに変換しても、なにも進んでないんです。
64, 179, 198行目の修正箇所はどういったところでしょうか?それとも今、WordPressのエディタ上のテンプレートをもう一度お送りしなおしたほうがよういでしょうか?
お忙しいところ申し訳ありませんが宜しくお願い致します。
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングしつれいしました。以下になります。
<?php /* Template Name:ブログページのテンプレート */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php bloginfo('name'); ?>|<?php if(in_category('3')): ?>Media - メディア/掲載等<?php endif; ?><?php if(in_category('4')): ?>Works - 制作実績紹介 [映画]<?php endif; ?><?php if(in_category('5')): ?>Information - 出演・受賞などのお知らせ一覧<?php endif; ?><?php if(in_category('6')): ?>Works - 制作実績紹介 [TV]<?php endif; ?><?php if(in_category('7')): ?>Works - 制作実績紹介 [出演]<?php endif; ?><?php if(in_category('8')): ?>Works - 制作実績紹介 [企画・プロデュース]<?php endif; ?><?php if(in_category('9')): ?>Works - 制作実績紹介 [WEB-CF]<?php endif; ?> <?php if(in_category('13')): ?>Works - 制作実績紹介 [イベント]<?php endif; ?><?php if(in_category('23')): ?>Works - 制作実績紹介 [講演・登壇]<?php endif; ?></title> <!-- META[Don't Delete]// --> <meta name="keywords" content="" /> <meta name="description" content="<?php bloginfo('description'); ?>" /> <meta name="robots" content="INDEX,FOLLOW" /> <meta name="copyright" content="Copyright © 2010 Shun Coney All Rights Reserved." /> <!--link rel="shortcut icon" type="image/x-icon" href="images/common/favicon.ico" /--> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <!-- CSS[Don't Delete]// --> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/import.css" /> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/tweet.css" /> <!-- Javascript Default Adoptor// --> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/css_browser_selector.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/swfobject.js"></script> <script type="text/javascript"> swfobject.embedSWF("ImageGallery.swf","flashcontent","960","330","9.0.0"); </script> <!--[if lte IE 6]> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/DD_belatedPNG_0.0.8a.js"></script> <script type="text/javascript"> DD_belatedPNG.fix('img, #headerLogo'); </script> <![endif]--> <!-- Javascript Packages jQuery[Editable]// --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jQuery/fadeButton.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jQuery/jquery.twit.0.2.0.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jQuery/twitterAccount.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jQuery/ipadGallery.js"></script> <?php load_template(TEMPLATEPATH . '/google_analytics.php'); ?> </head> <body> <div id="wrapper"> <div id="container"> <?php load_template(TEMPLATEPATH . '/header.php'); ?> <!--div id="mainVisualPages"> メインビジュアル下層 </div--><!--//mainVisualPages end--> <div id="plistBoxPages"> <p class="magl10 magt10">">TOP >> <?php if(in_category('4')): ?>/works/">Works - 制作実績紹介 >> 映画 <?php endif; ?><?php if(in_category('5')): ?>Information - 出演・受賞などのお知らせ一覧<?php endif; ?><?php if(in_category('6')): ?>/works/">Works - 制作実績紹介 >> TV <?php endif; ?><?php if(in_category('7')): ?>/works/">Works - 制作実績紹介 >> 出演 <?php endif; ?><?php if(in_category('3')): ?>Media - メディア/掲載等 <?php endif; ?><?php if(in_category('8')): ?>/works/">Works - 制作実績紹介 >> 企画・プロデュース <?php endif; ?><?php if(in_category('9')): ?>/works/">Works - 制作実績紹介 >> WEB-CF <?php endif; ?><?php if(in_category('13')): ?>/works/">Works - 制作実績紹介 >> イベント <?php endif; ?><?php if(in_category('23')): ?>/works/">Works - 制作実績紹介 >> 講演・登壇 <?php endif; ?></p> </div><!--//mainVisualPages end--> <div id="contentsPages" class="clearfix"> <div id="leftPages" class="boxL"> <div class="magt10"> <?php if(in_category('5')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_information.gif" alt="Information from this website [最新情報]" width="650" height="35" /></h3> <p id="galleryDescription" class="magl10 magt10"></p> <div class="magl10 magt10 magb10"> <img src="<?php bloginfo('template_directory'); ?>/images/common/informationSlide.jpg" alt="イメージテキスト" width="640" height="115" border="0" /> </div> <h5 class="magl10 magt20 magb20" style="font-size:14px; color:#333333!important;">【 これまでのお知らせ・最新情報の一覧 】</h5> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('4')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_work.gif" alt="Works [制作実績一覧]" width="650" height="35" /></h3> <h5 class="magl10 magt10" style="font-size:14px; color:#333333!important;"><span class="yellow">◆</span> 制作実績一覧:映画</h5> <p id="galleryDescription" class="magl10 magt10 magb20"></p> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('7')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_work.gif" alt="Works [制作実績一覧]" width="650" height="35" /></h3> <h5 class="magl10 magt10 magb20" style="font-size:14px; color:#333333!important;"><span class="green">◆</span> 制作実績一覧:出演</h5> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('6')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_work.gif" alt="Works [制作実績一覧]" width="650" height="35" /></h3> <!--div class="magl10 magt10 magb10"> <img src="<?php bloginfo('template_directory'); ?>/images/common/informationSlide.jpg" alt="イメージテキスト" width="640" height="115" border="0" /> </div--> <h5 class="magl10 magt10 magb20" style="font-size:14px; color:#333333!important;"><span class="red">◆</span> 制作実績一覧:TV</h5> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('9')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_work.gif" alt="Works [制作実績一覧]" width="650" height="35" /></h3> <h5 class="magl10 magt10 magb20" style="font-size:14px; color:#333333!important;"><span class="orange">◆</span> 制作実績一覧:WEB-CF</h5> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('13')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_work.gif" alt="Works [制作実績一覧]" width="650" height="35" /></h3> <h5 class="magl10 magt10 magb20" style="font-size:14px; color:#333333!important;"><span class="purple">◆</span> イベント</h5> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('23')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_work.gif" alt="Works [制作実績一覧]" width="650" height="35" /></h3> <h5 class="magl10 magt10 magb20" style="font-size:14px; color:#333333!important;"><span class="gunjo">◆</span> 講演・登壇</h5> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('8')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_work.gif" alt="Works [制作実績一覧]" width="650" height="35" /></h3> <h5 class="magl10 magt10 magb20" style="font-size:14px; color:#333333!important;"><span class="blue">◆</span> 制作実績一覧:企画・プロデュース</h5> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('3')): ?> <h3 id="leftTopInfo"><img src="<?php bloginfo('template_directory'); ?>/images/contents/h3_media.gif" alt="Works [メディア/掲載等]" width="650" height="35" /></h3> <p id="galleryDescription" class="magl10 magt10 magb20">各メディア(TV・ラジオ等)への出演実績ならびにWebや出版物への掲載情報等を公開しております。</p> <!--div class="magl10 magt10 magb10"> <img src="<?php bloginfo('template_directory'); ?>/images/common/informationSlide.jpg" alt="イメージテキスト" width="640" height="115" border="0" /> </div--> <!--h5 class="magl10 magt10 magb20" style="font-size:14px; color:#333333!important;"><span class="red">◆</span> 制作実績一覧:TV</h5--> <div class="magl10" style="border-bottom:dotted 1px #999;"></div> <?php endif; ?> <?php if(in_category('5')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <dl class="newsBlock magt10"> <dt><?php the_time('Y.m.d') ?></dt> <?php if ( get_post_meta($post->ID, '外部ページURL(カテゴリ:お知らせ・最新情報)') ) : ?> <dd>ID, '外部ページURL(カテゴリ:お知らせ・最新情報)',true); ?>" target="_blank"><?php the_title(); ?></dd> <?php endif; ?> <?php if ( !get_post_meta($post->ID, '外部ページURL(カテゴリ:お知らせ・最新情報)') ) : ?> <dd><?php the_title(); ?></dd> <?php endif; ?> </dl> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('4')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag1-head">映画</span> "><?php the_title(); ?></h5> <div class="magt10 magb5"><?php the_content(); ?></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('6')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag2-head">TV</span> <?php the_title(); ?></h5> <div class="magt10 magb5 clearfix"><?php the_content(); ?></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('9')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag5-head">Web-CF</span> <?php the_title(); ?></h5> <div class="magt10 magb5 clearfix"><?php the_content(); ?></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('13')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag7-head">イベント</span> <?php the_title(); ?></h5> <div class="magt10 magb5 clearfix"><?php the_content(); ?></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('23')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag8-head">講演・登壇</span> <?php the_title(); ?></h5> <div class="magt10 magb5 clearfix"><?php the_content(); ?></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('7')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag3-head">出演</span> <?php the_title(); ?></h5> <div class="magt10 magb5 clearfix"><?php the_content(); ?></div> <div style="height:10px;"></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('8')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag4-head">企画・プロデュース</span> <?php the_title(); ?></h5> <div class="magt10 magb5 clearfix"><?php the_content(); ?></div> <div style="height:10px;"></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <?php if(in_category('3')): ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <div class="magl10 ListArea2"> <h5 class="magt10"><span class="tag6-head">メディア・掲載等</span> <?php the_title(); ?></h5> <div class="magt10 magb5 clearfix"><?php the_content(); ?></div> <div style="height:10px;"></div> </div> <?php endwhile; endif; ?> <?php endif; ?> <div class="PagerArea magt20 magb20"><p></p></div> </div> </div><!--//leftPages end--> <div id="rightPages" class="boxR magl20"> <?php load_template(TEMPLATEPATH . '/sidebar.php'); ?> </div><!--//rightPages end--> </div><!--//contentsPages end--> <?php load_template(TEMPLATEPATH . '/footer.php'); ?> </div><!--//container end--> </div><!--//wrapper end--> <?php load_template(TEMPLATEPATH . '/twitter_badge.php'); ?> </body> </html>
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページング>ページングの処理がうまくいかない場合については、query_posts() を使用されておりかつ適切なパラメータを渡していない可能性が想像されますが、そういうことはありませんか?
query_posts()を書いていませんでした。そもそもページングに必要だとはまったく思いませんでした。
(googleで調べてみましたが、該当しそうなものまったく見当たらず)しかし、どうやって書けばいいか皆目検討がつかず、混乱が混乱を招いて、もうぐっちゃぐちゃなんです(T T)
最悪、外注も視野に・・・とか悪い方向へ考えてしまう自分がいますが・・・
もう少し混乱してみますが、よろしくお願い致します。
(まだうまくいきません・・・もう嫌だー!!)
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングmizube様
ありがとうございます。本当に今ノイローゼに近い状態で…とても嬉しいです。
太字になっている箇所は以下の部分です。
親カテゴリー1の一覧ページ(ページ+自作のページングで何とかクリア)・子カテゴリー:1-1の一覧ページ
・子カテゴリー:1-2の一覧ページ
・子カテゴリー:1-3の一覧ページ
・子カテゴリー:1-4の一覧ページ
・子カテゴリー:1-5の一覧ページ・親カテゴリー2の一覧ページ
・の部分はindex.phpでカテゴリーわけを行って作っているんですが、ページングをつけると2ページ目以降は条件分岐はすべて無視され、ifで指定した部分は真っ白になります。正しい書き方をしているのにページ送りにならないばかりか、ifの指定はすべて切られます。
(使用テンプレート)
「PHPファイル」
gallery.php (gallery.php)
gallery_ip.php (gallery_ip.php)
google_analytics.php (google_analytics.php)
meta_gallery.php (meta_gallery.php)
meta_gallery_html5.php (meta_gallery_html5.php)
meta_top.php (meta_top.php)
toppage.php (toppage.php)
twitter_badge.php (twitter_badge.php)
works.php (works.php)
サイドバー (sidebar.php)
フッター (footer.php)
ヘッダー (header.php)
ページテンプレート (page.php)
メインインデックスのテンプレート (index.php)←「今回はカテゴリーによって表記を分ける処理をここにすべて書いています。」
単一記事の投稿 (single.php)「スタイル」
スタイルシート (style.css)(使用PI)
WP-PageNavi
WP-Optimize現在の状態ではアーカイブテンプレートとカテゴリーのテンプレートがないので、すべてindex.phpに処理を書き、場合わけをしています。
今日は会社休んでいるので、何かあればすぐレスします。
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングそれとも今回はWordPressでページング(カテゴリー記事)はキレイさっぱりあきらめて、PHP直組みでつくり直したほうが、いいのでしょうか?
カテゴリー毎にテンプレートを用意するorアーカイブのテンプレートを用意するとかしたほうがいいのでしょうか?
愚痴みたいな書き方になって申し訳ないのですが、よろしくお願い致します。
因みに今日も会社も休んでいます(T T)
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングありがとうございます。
特にページングをつけない場合は、表示されています。
(特にエラーもないようです。)また、ページングをつけると2ページ目以降は条件分岐はすべて無視され、ifで指定した部分は真っ白になります。
googleなどでも、調べてみましたが、全く前例はないので、困っています。
試してはみたんですが結果変わらずです・・・・・
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングこのプラグインに関しても質問があります。
このプラグインは、ifを混在させてしまうと、機能としては意味を成さなくなるのでしょうか?
(そうだとしたら、ちょっと問題ですが・・・)Webの記事にも該当するものは全く持ってないので、本当に本当に困って困っています。
もし、テンプレートを見たいと言うことでありましたら、遠慮なく公開いたします。
何卒よろしくお願いします。
あ~こんなところで足踏みはごめんです。助けて(泣)
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページング案の定、不具合がおきてしまいました(T T)
メインのテンプレート(index.php)の中に
<?php if(in_category(‘7’)): ?>
<?php if(have_posts()): while(have_posts()): the_post(); ?>
…処理…
<?php endif; endwhile; ?>
<?php endif; ?><?php if(in_category(‘8’)): ?>
<?php if(have_posts()): while(have_posts()): the_post(); ?>
…処理…
<?php endif; endwhile; ?>
<?php endif; ?>という風に条件分岐を行って、wp-pagenaviプラグインを使用したところ、2ページ目以降が真っ白になってにっちもさっちも行かない状態です。
カテゴリによっては表示するレイアウトの変更もあったりします。
ほんとに2日間会社も休んで悩みあぐねて、このままではノイローゼにでもなりそうな感じなのですが、いかがすればいいのでしょう???
フォーラム: 使い方全般
返信が含まれるトピック: カテゴリー毎に作成(表示)した記事のページングありがとう御座います!
今回の設計ですと、TOPページに表示するのは、親カテゴリー3の最新5件で、あとは選択されたカテゴリーによって表示が変化(ビジュアルと画像)するくらいですね。