繁体   English   中英

在post - wordpress主题中显示特色图像

[英]display featured image in post - wordpress theme

我在我的本地wampp服务器上安装了wordpress。 问题是指第一次安装(二十次)后wordpress的默认主题。

我创建了一个测试帖,我试图在帖子中显示特色图片。 据我所知,我需要使用该功能:

   the_post_thumbnail

但是,由于我不熟悉wordpress主题开发,我不知道如何使用此函数或我应该修改的模板文件中的哪个文件。 非常感谢您对此问题的任何帮助。

你要调用该函数从内部 WordPress的循环 使用twentytwelve主题作为示例,打开single.php (这是单个帖子的详细视图的默认模板)。 您可以在第15 - 27行之间的任何位置使用此功能。

如果您想在页面 (而不是帖子)中显示图像,那么您将编辑page.php

Codex有关于如何使用the_post_thumnail()函数的更详细信息(例如,如何请求不同的图像大小)。

玩得开心!

它非常简单:打开你的style.css搜索

@media screen and (max-width: 400px) {

or search

.list-view .site-content .cat-links,
    .list-view .site-content .type-post .entry-content,
    .list-view .site-content .type-page .entry-content,
    .list-view .site-content .type-post .entry-summary,
    .list-view .site-content .type-page .entry-summary,
    .list-view .site-content footer.entry-meta {
        /*display: none; jay*/
    }

and comment this line
display: none;

多数民众赞成,问题将得到解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM