ワードプレスで、あるカテゴリの記事の、サムネイル一覧を表示させようと思っています。
<?php
$paged = (int) get_query_var('paged');
$args = array(
'posts_per_page' => 9,
'category' => '11',
//'paged' => $paged,
//'orderby' => 'post_date',
//'order' => 'DESC',
//'post_type' => 'post',
//'post_status' => 'publish'
);
$the_query = new WP_Query($args);
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<li>
<?php the_post_thumbnail('rel_tmn', array('alt'=>get_the_title(), 'title'=>get_the_title())); ?>
<a href="<?php the_permalink(); ?>" alt="<?php the_title(); ?>"></a>
<?php if( function_exists('zilla_likes') ) zilla_likes(); ?>
</li>
<?php endwhile; endif; ?>
</ul>
カテゴリID「11」を指定しているのですが、全記事表示されてしまいます。
PHPに関してほとんど知識がないので、他のサイトからコードをコピーして貼り付けています。
どこを直せばいいのかわかるかた教えていただけますでしょうか。
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
- ・ゆるやかでぃべーと タイムマシンを破壊すべきか。
- ・歩いた自慢大会
- ・許せない心理テスト
- ・字面がカッコいい英単語
- ・これ何て呼びますか Part2
- ・人生で一番思い出に残ってる靴
- ・ゆるやかでぃべーと すべての高校生はアルバイトをするべきだ。
- ・初めて自分の家と他人の家が違う、と意識した時
- ・単二電池
- ・チョコミントアイス
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
WordPressのLighting(テーマ)に...
-
価格ドットコムのスマホアプリ...
-
ワードプレス プラグイン。プラ...
-
BECK!のカスタマイズについて
-
Lightningのテーマで、CSSでの...
-
Laravelをレンタルサーバーにイ...
-
統計グラフのテーマ
-
ロリポップからヘテムルへMT4...
-
Windows XPのスキン変更方法に...
-
wordpressでMOREタグが効かない
-
ワードプレス。lightning ペー...
-
ウィンドウズアップデートした...
-
ワードプレスWordpress フッタ...
-
ワードプレステーマkatawaraのCSS
-
ドメインの公開範囲の制限について
-
wordpressの「続きを読む」以降...
-
アメブロでツィッターのウィジ...
-
Got an error: CGIPathの設定が...
-
WordPressのプラグインとjQuery...
-
中古ドメインについて
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
WordPressのLighting(テーマ)に...
-
外部ファイルの読み込み
-
PHPのクッキーによるリダイレクト
-
変数で日付を指定し、新しい順...
-
wordpress投稿内でcgiを動かしたい
-
PHP+smartyで文字化け
-
wordpressのファイル構成について
-
URL短縮ツール「楽々URL」をさ...
-
Wordpress 入力内容有無の判定
-
Wordpressで記事がない場合にメ...
-
xreaでのWordpressインストール...
-
リンクがうまく機能しません(p...
-
Wordpressのサイト内検索ができ...
-
PHPでtwitterAPI利用時のサーバ...
-
PHP初心者です。
-
ワードプレスでカテゴリー毎に...
-
Smarty コンバートエラー??
-
wordpress カスタム投稿タイプ...
-
AVIRA FREE Antivirus について
-
サーバーへアプロード、エラー...
おすすめ情報