這裏的PHP noob - 全方位的網絡noob tbh。 Anyhoo一直試圖讓這一段時間現在。Wordpress PHP的帖子使用類別作爲查詢
該網站是http://talkativebroadcasting.co.uk
主要有所謂的「文章」的帖子的頁面 - 這就是做工精細
有一個「健談的博客」頁面,在這裏我只想用「博客」發佈類的帖子 - 工作正常上下的
有「膀胱癌」的子頁面調用的採訪,我只想類別「BTCC」的網頁或膀胱癌後的任何子目錄發佈 - 再次確定十歲上下
當前代碼page.php文件是
個<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('content', 'page'); ?>
<?php comments_template('', true); ?>
<?php
if (is_page('talkative-blog')) {
query_posts('category_name=BLOG');
} elseif (is_page(17)) {
query_posts('category_name=BTCC');
}
?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
主要問題仍然存在:
- 特色照片不再存在,也不是標籤等
- 如果說10個職位被加入,你不能去舊/更新的喜歡上了「帖子」頁面
- 事實上,這將是完美的,如果它經營一樣的‘信息’頁面,它將最終被隱藏,只在幕後操作
謝謝
喜SAM,你如果其他條件必須是這樣定義你的while循環前定義吹碼。 –