WordPress获取文章摘要函数:get_the_excerpt
WordPress函数get_the_excerpt用于获取文章的摘要,通常用在归档页输出文章列表时同时输出文章的摘要,文章页面也可以将摘要作为导读输出,更有用的是将摘要内容作为Descraption标签的内容。 …
WordPress函数get_the_excerpt用于获取文章的摘要,通常用在归档页输出文章列表时同时输出文章的摘要,文章页面也可以将摘要作为导读输出,更有用的是将摘要内容作为Descraption标签的内容。 …
WordPress函数get_next_posts_link用于在归档页获取下一页链接,在制作归档页翻页导航时非常有用。 get_next_posts_link( string $label = null, int $max_page = 0 ) 函数参数$label 字符串值,默认值:null …
WordPress函数get_next_post用于获取下一篇文章的信息,包括:文章内容、摘要、状态、标题、作者、发布时间等。 get_next_post( boolean $in_same_term = false, string $excluded_terms = '', string $taxonomy = 'category' ) 函数参数$in_same_term …
WordPress函数get_extended用于获取More标签分隔的内容,分别输出More标签前、后、中的内容,稍加变通就可以利用这个标签制作摘要输出、加密内容等。 get_extended( string $post_content ) 函数参数$post_content …
Bootstrap4 Carousel轮播非常简单好用,默认左右滚动效果,但通常的需求是三种情况:左右滚动(水平滚动)、上下滚动(垂直滚动)、淡入淡出。 通过增加少量的CSS,就可以为Bootstrap4 Carousel轮播增加上下滚动(垂直滚动)、淡入淡出效果。 …
WordPress函数get_children可用于获取文章下的附件、子页面,通常我用来获取文章缩略图。 get_children( array $args = '', constant $output = OBJECT ) 函数参数$args数组或字符串值 get_children()函数$args参数默认的值如下: …
WordPress函数get_boundary_post用于获取最早或最近发表的一篇文章,在实际应用中使用得非常少。 get_boundary_post( boolean $in_same_term = false, string $excluded_terms = '', boolean $start = true, string $taxonomy = 'category' ) 函数参数$in_same_cat …
WordPress函数get_adjacent_post用于获取相邻文章的信息,包括文章ID、文章发表时间、文章标题、文章别名、文章内容和文章摘要等。 get_adjacent_post( boolean $in_same_term = false, array $excluded_terms = '', boolean $previous = true, string $taxonomy = 'category' ) 函数参数$in_same_term …
WordPress模板标签the_search_query用于输出搜索关键词,通常用在搜索表单和搜索结果页中。 the_search_query() 该函数没有任何参数,直接调用即可。 函数使用示例<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/"> <div> <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <input type="submit" id="searchsubmit" value="Search" /> </div> </form> 扩展阅读the_search_query()函数位于:wp-includes/general-template.php …
Unslider是一款轻量的jQuery轮播插件,简单好用,但默认不支持鼠标悬停时停止播放功能,这是一般轮播插件都支持的功能,像Unslider这样优秀的插件应该是支持的,然而我读了一下源码也没发现有可用的参数支持该功能。 …