0

我有一个主题,使用下面的代码将帖子显示为缩略图,但它以错误的比例(400px x 300px)裁剪它,我不知道是什么告诉它这样做。我将如何更改以 210px x 210px 生成的缩略图?

<?php

    foreach($all_photo_arr as $key => $portfolio_item)
    {
        $cur_post++;
        $image_url = '';

        if(has_post_thumbnail($portfolio_item->ID, 'portfolio2'))
        {
            $image_id = get_post_thumbnail_id($portfolio_item->ID);
            $image_url = wp_get_attachment_image_src($image_id, 'portfolio2', true);
            $full_image_url = wp_get_attachment_image_src($image_id, true);
        }

        $last_class = '';
        $line_break = '';
        if(($key+1) % 4 == 0)
        {   
            $last_class = ' last';
            $line_break = '<br class="clear"/>';
        }

        $portfolio_link_url = get_post_meta($portfolio_item->ID, 'portfolio_link_url', true);

        if(empty($portfolio_link_url))
        {
            $permalink_url = get_permalink($portfolio_item->ID);
        }
        else
        {
            $permalink_url = $portfolio_link_url;
        }

        $portfolio_item_class = 'one_fourth';
        if(($key+1) % 4 == 0)
        {   
            $portfolio_item_class.= ' last';
        }

        $pp_portfolio_image_height = 210;
?>
4

2 回答 2

0

您可以在设置 > 媒体中更改缩略图大小。

于 2012-04-23T15:52:49.423 回答
0

这可能会有所帮助:

http://wordpress.org/support/topic/change-featured-image-size-only-on-homepage

于 2012-04-23T16:26:34.957 回答