Wordpress上的精选图片 [英] Featured Image on Wordpress

查看:156
本文介绍了Wordpress上的精选图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题...当我想显示我的帖子上的特色图片,所选择的大小不工作(照片显示在它自己的大小)。我想要的特色图像显示在相同的宽度作为后总宽度,但我没有线索!

I have a little problem... when I want to show the featured image on my posts, the chosen size isn't working (the photo is shown in it's own size). And I want the featured Image to be shown in the same width as the post total width but I have no clue!

这是我在PHP中使用的代码

This is the code I'm using in the PHP section

if ( function_exists( 'add_theme_support' ) ) add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(640, 205);

我的问题是...我必须把这个代码放在哪里?

My question is... where do I have to put this code?

<?php add_theme_support( 'post-thumbnails' );?>

我必须使用css来显示它与post总计的宽度相同宽度?
感谢

And what would be the css I have to use to show it in the same width as the post total width? Thanks

推荐答案

选择帖子选项,在右侧栏角落,您会发现选项作为精选图片更改更新,选择和更新您需要的图片。

Select Post option,at right side bar corner,you will find the option as Featured images changes and updates,select and update the image which you require.

另请尝试使用此代码格式:
the_post_thumbnail();
set_post_thumbnail_size(50,50);`add_image_size('single-post-thumbnail',590,180);

Else try with this Code format: the_post_thumbnail(); set_post_thumbnail_size( 50, 50);`add_image_size( 'single-post-thumbnail', 590, 180 );

这篇关于Wordpress上的精选图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆