post_id 就是元数据相关联的post,用户(user),评论(comment)的ID。 meta_key 元键(meta key)(这个值在不同的记录中经常是重复的)。 meta_value 元值(meta value)(往往是唯一的)。 如何获取特色图像 Featured Image 那么,对于一个文章,是如何来获取特色图像 Featured Image的,下面来看一下。在后台的文章编辑...
这些属性都是与文章相关的,同时根据 post_type的不同,该表还能用来存储特色图像 Featured Image。 由此可以看到,Wordpress 利用 post_type 可以在该表中存储草稿、文章、页面、附件等丰富的信息,一张表就搞定了。 wp_postmeta 表 与这张表相关联的,还有一个 wp_postmeta 表,用来存储与文章相关的元数据。这个表的...
例如,主页的主要部分是查询循环块,其功能是提供最新的博客文章。然而,它也由不同的块组成,即Post Title、Post Featured Image、Post Excerpt、Post Date、Spacer和Pagination。 如果你想改变它的外观,你可以很容易地做到。例如,您可以单击“文章特色图片”块,然后使用工具栏中的箭头将其移动到帖子标题的下方或上方。
Next, you need to edit the post where you want to display the extra text in the title field and add guest_post and sponsored_post in custom fields. 接下来,您需要编辑要在标题字段中显示额外文本的帖子,并在自定义字段中添加guest_post和Sponsored_post。 If any of these two custom fields are f...
特殊图片Featured Image,在文章中上传时,会在wp_posts 表创建新的一条记录。 Wordpress中图像物理文件保存在 wp-content/uploads 目录下,相关信息保存在 wp_posts 表中。post_type 是 attachment,post-mime-type 是 image/png。通过 post_parent 与文章关联。 wp_postmeta中post_id关联文章,meta_key为thumbnail_...
在WordPress中,可以通过设置特色图片(Featured Image)来为每篇文章或页面选择一张代表性的图片。 特色图片是一种在文章列表、归档页面和单篇文章中展示的图片。它可以为读者提供一个视觉上的引导,增加文章的吸引力和可读性。 设置post中第一张图片为特色图片的步骤如下: 在WordPress后台,选择“文章”或“页面”菜单,...
通过函数set_post_thumbnail_size()可以生成默认的文章缩略图。 除此之外,我们还可以通过调用add_image_size();来增加额外的文章缩略图尺寸,然后在文章页面通过the_post_thumbnail( );调用新的缩略图尺寸来显示新的缩略图。 WPJAM Basic 对文章缩略图的增强 ...
那么,对于一个文章,是如何来获取特色图像 Featured Image的,下面来看一下。在后台的文章编辑界面,特色图像显示在这个位置。 对应的后台代码是 wp-admin/includes/meta-boxes.php /** * Display post thumbnail meta box. * *@since2.9.0 * *@paramWP_Post $post A post object. ...
访问后台>>设置>>媒体,缩略图大小这一项就是特色图像(Featured Image or Thumbnail)的尺寸,也就是the_post_thumbnail()不加参数时调用的图片的尺寸。根据需要修改其参数即可。上传图片时WordPress会自定生成这个尺寸的图片。 为文章添加特色图片的三种方法
Description When dragging an image onto the Post featured image drop zone, the button to set an image is replaced with the drop zone. The visible text string changes from: Set featured image to: Drop files to upload, preceded by an icon...