如何查找网站的 RSS 提要(附示例) 如果您曾经想知道如何找到网站的 RSS 提要,那么本指南会派上用场! RSS 提要是掌握来自博客、网站和社交媒体的最新消息的绝佳方式。这些在线文件是极好的信息来源,可以激发您为受众创建相关内容。 但这还不是全部:您可以将...
WordPress获取文章缩略图函数:get_the_post_thumbnail WordPress函数get_the_post_thumbnail用于获取文章的缩略图,该函数会直接返回带有img标签的缩略图。 get_the_post_thumbnail( int $post = null, str...
WordPress获取文章数据函数:get_post WordPress函数get_post用于获取文章的数据,包括文章内容、标题、别名、摘要、发布时间等信息。 get_post( int $post = null, string $output = OBJECT, str...
WordPress获取父页面ID函数:get_post_ancestors WordPress函数get_post_ancestors用于获取父页面的ID,通常在企业模板中,侧边栏需要显示页面导航,例如:公司简介、企业文化、人才招聘等等,就可能需要用get_post_ancestors函数来获取...
WordPress获取附件MIME类型函数:get_post_mime_type WordPress函数get_post_mime_type主要用于获取附件的MIME类型,当然也能返回文章、页面的MIME类型,但在实际应用中这并没有什么用处。 get_post_mime_type( int $ID )...
WordPress获取文章状态函数:get_post_status WordPress函数get_post_status用于获取文章的状态,比较少用到。 get_post_status( int $ID ) 函数参数 $ID 整数型,默认为空 文章的ID 函数返回值 publish:公开...
WordPress获取文章形式函数:get_post_format WordPress函数get_post_format用于获取文章的形式,在为不同形式的文章制作不同的模板时非常有用。 get_post_format( int $post = null ) 函数参数 $post_id 整...
WordPress获取编辑文章链接函数:get_edit_post_link WordPress函数get_edit_post_link用于获取文章的编辑链接,需要用户登录网站后台才能获取到编辑文章的链接,如果未登录状态则不返回任何内容。 get_edit_post_link( integer $...
WordPress获取删除文章链接函数:get_delete_post_link WordPress函数get_delete_post_link获取删除文章的链接,访问获取到的这个链接将会把这篇文章移至回收站。该函数可以用于The Loop主循环或主循环之外。 get_delete_post_link...
WordPress获取上一篇文章函数:get_previous_post WordPress函数get_previous_post用于获取上一篇文章,可以限制返回相同分类的上一篇文章,需要用在文章页面模板里。 get_previous_post( boolean $in_same_cat, s...
WordPress分类归档上一页标签:previous_posts_link WordPress模板标签previous_posts_link用于在分类、标签、日期等归档页输出上一页链接,需要注意是用在The Loop主循环之外。 previous_posts_link( string $labe...
WordPress获取文章标签:get_posts WordPress模板标签get_posts用于获取文章信息,通常用于输出最新文章列表、随机文章、指定分类文章等等,在用WordPress制作CMS网站时非常有用。 get_posts( array $args = nu...
WordPress判断文章页面函数:is_single WordPress函数is_single用于判断是否文章类型为post的页面,但不包括附件(attachments)和页面(page)。换句话说,is_single()函数判断当前页面是否是文章页面,如果要包含附件和页面...
WordPress获取当前文章ID标签:the_ID WordPress模板标签the_ID用于输出当前文章的ID,需要用在The Loop主循环里。 the_ID() 使用示例: <p>文章ID: <?php the_ID(); ?></p&...
WordPress判断置顶文章函数:is_sticky WordPress函数is_sticky用于判断当前文章是否置顶,在WordPress主题的制作中,可以通过判断文章是否置顶以应用不同的样式,例如加一个推荐的标签。 is_sticky(int $post_ID) 函数参...
WordPress文章发表日期标签:the_date WordPress模板标签the_date输出当前文章的发表日期,需要用在The Loop主循环中。 the_date( string $d = '', string $before = '', string $afte...
WordPress获取最新文章函数:wp_get_recent_posts WordPress函数wp_get_recent_posts用于获取最新文章,包括文章的标题、别名、状态、发表时间、修改时间、内容等信息。 wp_get_recent_posts( array $args, string...
WordPress判断文章是否设置了特色图像函数:has_post_thumbnail WordPress函数has_post_thumbnail用于判断当前文章是否设置了特色图像,即是否包含缩略图。 has_post_thumbnail( int|WP_Post $post = null ) 函数参数 $...
WordPress判断是否指定文章类型归档页函数:is_post_type_archive WordPress函数is_post_type_archive用于判断是否指定的文章类型归档页。 is_post_type_archive( string|string[] $post_types = '' ) 函数参数...
WordPress注册文章类型函数:register_post_type WordPress函数register_post_type用于注册新的文章类型,不应该在init动作前挂载,所有分类法都通过$taxonomies参数注册,以确保在使用诸如“parse_query”或“pre_get_p...