2012-07-30 96 views
0

我想一个功能添加到一个WordPress页面中显示的人的短名单,像一个在这里看到 - http://www.blenderbox.com/company/team如何在CSS样式的HTML列表中添加到WordPress,管理仪表板

我已通过使用css样式列表在其他网站上完成此操作。然而这一次,这是一个客户端,我不能相信他们复制并粘贴<li>,编辑名称,职位名称和img名称而不会搞乱它。

什么是最好的方式来创建这个,以便它可以轻松地减少/添加到WordPress的仪表板?基本上,这样用户只需点击“添加人员”,然后填写一些字段,然后再更新页面。

我是新来的WordPress(虽然我理解它是如何工作的),但我有能力编码,所以希望在正确的方向信息的微调就足够了。

谢谢,本。

+0

如果这不是一个编码问题,它可能应该在Wordpress Stack Exchange上,而不是http://wordpress.stackexchange.com/。 – 2012-07-30 23:07:06

+0

这个问题似乎是无关紧要的,因为它涉及到使用Wordpress。 – KatieK 2013-06-28 17:54:21

回答

0

使用类别。创建一个名为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); 
相关问题