WordPress 数据库中存储的帖子特色图片链接在哪里? [英] Where is the post featured image link stored in the WordPress database?

查看:41
本文介绍了WordPress 数据库中存储的帖子特色图片链接在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

特色图片链接存储在 WordPress 数据库中的什么位置?我在 wp_postmeta 表中搜索,但找不到确切的 post_idlinks.

Where is the featured image link stored in the WordPress Database? I searched in the wp_postmeta table but I cannot find out the exact post_id and links.

这是正确的吗?任何人都可以向我解释它是如何工作的吗?

Is this correct? Could anyone please explain to me how it works?

推荐答案

特色图片 ID 存储在 wp_postmeta 中,meta_key 名为 _thumbnail_id>.示例:

The featured image ID is stored in wp_postmeta with a meta_key called _thumbnail_id. Example:

╔═════════╦═════════╦═══════════════╦═══════════╗
║ meta_id ║ post_id ║ meta_key      ║ meta_value║
╠═════════╬═════════╬═══════════════╬═══════════╣
║ 200     ║ 4       ║ _thumbnail_id ║ 48        ║
╚═════════╩═════════╩═══════════════╩═══════════╝

实际的缩略图链接包含在 wp_posts 中,带有 attachmentpost_type.示例:

The actual thumbnail link is then contained in wp_posts with a post_type of attachment. Example:

╔════╦════════════╦═════════════════════════════════════════════════════╗
║ ID ║ post_type  ║ guid                                                ║
╠════╬════════════╬═════════════════════════════════════════════════════╣
║ 48 ║ attachment ║ http://example.com/wp-content/uploads/yourimage.png ║
╚════╩════════════╩═════════════════════════════════════════════════════╝

这篇关于WordPress 数据库中存储的帖子特色图片链接在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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