mirror of https://github.com/vtrois/kratos
parent
1934710b9b
commit
e270b99533
|
@ -573,8 +573,8 @@ button:focus {
|
||||||
float: left;
|
float: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
width: 240px;
|
width: 256px;
|
||||||
height: 145px;
|
height: 144px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.k-main .board .article-panel .a-thumb img {
|
.k-main .board .article-panel .a-thumb img {
|
||||||
|
|
|
@ -101,12 +101,15 @@ add_filter('excerpt_length', 'excerpt_length');
|
||||||
// 开启特色图
|
// 开启特色图
|
||||||
add_theme_support("post-thumbnails");
|
add_theme_support("post-thumbnails");
|
||||||
|
|
||||||
|
// 生成适合特色图的比例图片
|
||||||
|
add_image_size( 'kratos-thumbnail', 512, 288, true );
|
||||||
|
|
||||||
// 文章特色图片
|
// 文章特色图片
|
||||||
function post_thumbnail()
|
function post_thumbnail()
|
||||||
{
|
{
|
||||||
global $post;
|
global $post;
|
||||||
$img_id = get_post_thumbnail_id();
|
$img_id = get_post_thumbnail_id();
|
||||||
$img_url = wp_get_attachment_image_src($img_id, array(720, 435));
|
$img_url = wp_get_attachment_image_src($img_id, 'kratos-thumbnail');
|
||||||
if (is_array($img_url)) {
|
if (is_array($img_url)) {
|
||||||
$img_url = $img_url[0];
|
$img_url = $img_url[0];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue