0

我将我的 wordpress 网站托管在Amazon Linux AMI 2012.03. 每当我将任何自定义主题上传到我的网站时,帖子的缩略图都无法显示在我的主页上

当我搜索答案社区时,有人建议我安装php-gd,我就这样做了。它运行良好,缩略图出现在我的主页上。我不知道为什么,两天后又出现了同样的问题。

谁能帮我解决这个问题。我不是专业的开发人员或程序员。所以,请详细说明。请告诉我该做什么以及如何去做。

4

1 回答 1

1

你已经在 php.ini 中检查了 gd 扩展启用与否

并阅读

http://www.roseindia.net/tutorial/php/phpgd/About-thumbnail.html

http://davidwalsh.name/create-image-thumbnail-php

阅读以下网址:-

http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

http://codex.wordpress.org/Function_Reference/the_post_thumbnail

或者

尝试这个:-

<?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?> 

<?php $pages = get_pages(array('child_of' => 1)); ?> 
<ul>
    <?php foreach ($pages as $page): ?>
        <li>
            <?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
            <h1><?php echo $page->post_title; ?></h1>
            <?php echo $page->post_content; ?>
        </li>
    <?php endforeach; ?>
</ul>

缩略图大小

get_the_post_thumbnail($id);                  // without parameter -> Thumbnail

get_the_post_thumbnail($id, 'thumbnail');     // Thumbnail
get_the_post_thumbnail($id, 'medium');        // Medium resolution
get_the_post_thumbnail($id, 'large');         // Large resolution
get_the_post_thumbnail($id, 'full');          // Original resolution

get_the_post_thumbnail($id, array(100,100) ); // Other resolutions
于 2012-07-29T13:21:15.660 回答