使用類別。創建一個名爲Person或Team的新類別或其他類似的功能。然後將帖子標題用於名稱 - 可以在帖子中添加任何其他信息,然後將圖像添加到精選圖片。
通過複製另一個模板文件併爲其指定一個標題來爲此頁創建一個新模板。
<?
/*
Template Name: About Us/Team/Whatever
*/
?>
,並在頁面只調用的信息,你想是這樣的:
//Set up the Loop
<?php
global $post;
$args = array (
'category' => 4,
'order' => 'ASC');
$teamposts = get_posts($args);
foreach($teamposts as $post) : setup_postdata($post); ?>
//Call the information you want - put them in <li> if you need
<?php the_title();?>
<?php the_excerpt();?> //OR the_content
<?php the_post_thumbnail('new-image-size');?>
//Close the loop
<?php endforeach; ?>
然後,您可以繼續撥打其他任何你想要或在同一頁上運行另一個循環調用其他信息。
爲了得到正確大小的縮略圖,您稱之爲「新圖像大小」 - 要設置它,請在您的functions.php文件中添加一行。
// Post Thumbnails
add_theme_support('post-thumbnails');
// name of the thumbnail, width, height, crop mode
add_image_size('front-page-services', 450, 270, true);
如果這不是一個編碼問題,它可能應該在Wordpress Stack Exchange上,而不是http://wordpress.stackexchange.com/。 – 2012-07-30 23:07:06
這個問題似乎是無關緊要的,因爲它涉及到使用Wordpress。 – KatieK 2013-06-28 17:54:21