WordPress获取相邻文章函数:get_adjacent_post 发布于2022/07/13 WordPress函数get_adjacent_post用于获取相邻文章的信息,包括文章ID、文章发表时间、文章标题、文章别名、文章内容和文章摘要等。 get_adjacent_post( boolean $in_same_term··· 查看详情
WordPress获取最早或最近文章函数:get_boundary_post 发布于2022/07/13 WordPress函数get_boundary_post用于获取最早或最近发表的一篇文章,在实际应用中使用得非常少。 get_boundary_post( boolean $in_same_term = false, string $excluded_terms··· 查看详情
WordPress获取文章子元素函数:get_children 发布于2022/07/13 WordPress函数get_children可用于获取文章下的附件、子页面,通常我用来获取文章缩略图。 get_children( array $args = '', constant $output = OBJECT ) 函数参数 $args 数组··· 查看详情
WordPress获取More标签分隔内容函数:get_extended 发布于2022/07/13 WordPress函数get_extended用于获取More标签分隔的内容,分别输出More标签前、后、中的内容,稍加变通就可以利用这个标签制作摘要输出、加密内容等。 get_extended( string $p··· 查看详情
WordPress获取下一页链接函数:get_next_posts_link 发布于2022/07/13 WordPress函数get_next_posts_link用于在归档页获取下一页链接,在制作归档页翻页导航时非常有用。 get_next_posts_link( string $label = null, int $max_page = 0 ) 函数参··· 查看详情
WordPress获取下一篇文章信息函数:get_next_post 发布于2022/07/13 WordPress函数get_next_post用于获取下一篇文章的信息,包括:文章内容、摘要、状态、标题、作者、发布时间等。 get_next_post( boolean $in_same_term = false, string $excl··· 查看详情
WordPress输出文章固定链接标签:the_permalink 发布于2022/07/13 WordPress模板标签the_permalink用于输出文章的固定链接,即伪静态形式的链接地址,需要用在The Loop主循环中。 the_permalink( $post = 0 ) 该函数没有参数,事实上the_perma··· 查看详情
WordPress获取固定链接标签:get_permalink 发布于2022/07/13 WordPress模板标签get_permalink用于获取文章的固定链接,也就是伪静态链接,需要用在The Loop主循环中,如果在主循环之外使用,需要传递文章ID或包含文章信息的对象。 get_pe··· 查看详情
WordPress获取文章摘要函数:get_the_excerpt 发布于2022/07/13 WordPress函数get_the_excerpt用于获取文章的摘要,通常用在归档页输出文章列表时同时输出文章的摘要,文章页面也可以将摘要作为导读输出,更有用的是将摘要内容作为Descrapti··· 查看详情
WordPress输出文章摘要标签:the_excerpt 发布于2022/07/13 WordPress模板标签the_excerpt用于输出文章的摘要,需要用在The Loop主循环。如果当前文章有填写“摘要”,the_excerpt()函数输出这个摘要内容,否则自动截断文章内容的前55个字··· 查看详情
WordPress获取文章缩略图函数:get_the_post_thumbnail 发布于2022/07/13 WordPress函数get_the_post_thumbnail用于获取文章的缩略图,该函数会直接返回带有img标签的缩略图。 get_the_post_thumbnail( int $post = null, string|array $size = 'post··· 查看详情
WordPress获取文章数据函数:get_post 发布于2022/07/13 WordPress函数get_post用于获取文章的数据,包括文章内容、标题、别名、摘要、发布时间等信息。 get_post( int $post = null, string $output = OBJECT, string $filter = 'ra··· 查看详情