我确信这非常简单,我想做的就是使用它使图像在页面上居中。
echo get_the_post_thumbnail( $post_id );
任何帮助将不胜感激!提前致谢
最佳答案
echo get_the_post_thumbnail( $post_id, 'post-thumbnail', array( 'class' => 'center-img' ) );
然后在您的 style.css 中创建一个类 center-img:
.center-img {
display: block;
margin-left: auto;
margin-right: auto;
}
关于php - 我怎样才能让这个得到 echo ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11248799/