函数共65篇
WordPress函数get_template_part()-龙网 - 教程、网赚、安全、免费资源

WordPress函数get_template_part()

介绍 get_template_part( string $slug, string $name = null ) get_template_part()是用于调用主题目录中的文件。 参数 $slug (string) (必填) The slug name for the generic template. $name...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
08944
WordPress函数wp register sidebar widget添加自定义小工具-龙网 - 教程、网赚、安全、免费资源

WordPress函数wp register sidebar widget添加自定义小工具

wp register sidebar widget 取代了register_sidebar_widget函数,它提供了函数接口,方便的制作小工具。 用法 <?php wp_register_sidebar_widget( $id, $name, $output_callback, $options,...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
03667
WordPress注册js函数wp_enqueue_script()-龙网 - 教程、网赚、安全、免费资源

WordPress注册js函数wp_enqueue_script()

wp_enqueue_script( string $handle, string $src = '', array $deps = array(), string|bool|null $ver = false, bool $in_footer = false ) wp_enqueue_script() 是WordPress注册和引用一个js...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
0100125
WordPress函数:register post type (自定义文章类型)用法和范例-龙网 - 教程、网赚、安全、免费资源

WordPress函数:register post type (自定义文章类型)用法和范例

register post type() 函数支持我们创建一个自定义的文章类型,或者修改已有的文章类型,该函数不能在init动作之前使用。 用法 <?php register_post_type( $post_type, $args ) ?> 参数 $...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
05634
WordPress函数get_calendar()日历标签-龙网 - 教程、网赚、安全、免费资源

WordPress函数get_calendar()日历标签

介绍 get_calendar()是一个WordPress日历标签,可以在 WordPress主题 的任意模板中使用,并不需要在 the_loop 中。 默认会显示当前年月的一个日历,并且会在有日志的日期中带上日期的 date 链接...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
059120
WordPress函数:register_sidebar()创建主题侧边栏-龙网 - 教程、网赚、安全、免费资源

WordPress函数:register_sidebar()创建主题侧边栏

制作的wordpress主题默认是不支持WordPress后台 – 外观 – 小工具的,需要手动在functions.php里注册我们的边栏小工具。 1、用法: 使用函数register_sidebar()注册一个单独的侧边栏区域和返回...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
095104
WordPress函数 get_footer()-龙网 - 教程、网赚、安全、免费资源

WordPress函数 get_footer()

介绍 包含当前主题目录中的footer.php模板文件。 如果指定了名称,则将包含专门的页脚 -{name}.php。 如果主题不包含footer.php文件,则将包含默认主题 wp-includes/theme-compat/footer.php 中...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
09356
WordPress使用函数wp_register_sidebar_widget添加随机文章小工具-龙网 - 教程、网赚、安全、免费资源

WordPress使用函数wp_register_sidebar_widget添加随机文章小工具

wp_register_sidebar_widget函数让我们很轻松的在边栏添加小工具,做一个随机文章的小工具,当然这个函数添加的小工具只能使用一次,你如果反复多次多边栏调用,采用下面的方法。 WordPress 开...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
09753
WordPress函数the_author()-龙网 - 教程、网赚、安全、免费资源

WordPress函数the_author()

介绍 the_author() 是显示作者公开名的函数,此函数必须在 the_loop 循环标签内使用才有效。 使用 <?php the_author(); ?> 示例 显示公开名: <p>This post was written by <?ph...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
07090
WordPress函数:wp_tag_cloud(标签云)详解和举例-龙网 - 教程、网赚、安全、免费资源

WordPress函数:wp_tag_cloud(标签云)详解和举例

wp_tag_cloud() 函数的作用是用来标签云的,可以根据每个标签所关联的文章次数来定义字体大小、标签排序等属性。从 2.8 版本开始,添加了 分类法(taxonomy)参数,这就意味着,除了 标签(tags...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
057111
WordPress函数single_post_title()-龙网 - 教程、网赚、安全、免费资源

WordPress函数single_post_title()

介绍 显示single、page页面标题,这个标签不必在the_loop循环中,只要在single、page页面即可。 使用 <?php single_post_title(); ?> 参数 $prefix (string) (可选) 显示在标题前的文本。...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
036125
Bootstrap替换WordPress的get_search_form()搜索样式-龙网 - 教程、网赚、安全、免费资源

Bootstrap替换WordPress的get_search_form()搜索样式

get_search_form()本函数的作用主要是包含searchform.php,它的作用和get_header()、get_sidebar()、get_footer()类似的,在需要插入搜索框的地方,调用该函数即可。如果主题里面没有searchform...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
08282
WordPress函数 get_sidebar()-龙网 - 教程、网赚、安全、免费资源

WordPress函数 get_sidebar()

介绍 主题边栏模板调用函数,可以调用一些特别的边栏'sidebar-special.php',如这样。 参数 $name (string) (Optional) The name of the specialised sidebar. Default value: null 示例 调用你...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
010171
WordPress侧边dynamic_sidebar()函数举例-龙网 - 教程、网赚、安全、免费资源

WordPress侧边dynamic_sidebar()函数举例

在开发wordpress主题的过程中,要涉及到侧边栏工具的开发,比如添加最近文章,文章归档,最新评论,标签云,搜索框,类别,链接表等,最新访客,统计,广告,订阅等等,这就用到了ynamic_sideba...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
07184
WordPress函数wp_dropdown_users()-龙网 - 教程、网赚、安全、免费资源

WordPress函数wp_dropdown_users()

介绍 创建一个下拉选择输出所有作者。 使用 <?php wp_dropdown_users( $args ); ?> 默认使用 <?php $args = array( 'show_option_all' => null, // string 'show_option_none' =>...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
068128
WordPress函数:get_template_part()调用你的自定义模板-龙网 - 教程、网赚、安全、免费资源

WordPress函数:get_template_part()调用你的自定义模板

et_template_part() 函数用于调用自定义模板文件,也可以引入自定义名字的文件。使用get_template_part()函数,可以更灵活的控制主题,我觉得get_template_part()函数最大的好处就是大大的减少...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
0655238
WordPress函数get_archives_link()-龙网 - 教程、网赚、安全、免费资源

WordPress函数get_archives_link()

描述 根据预定义或自定义代码检索存档链接内容。 格式可以是四种样式之一。head 元素的“link”、select 元素中使用的“option”、列表中使用的“html”(ol 或 ul HTML 元素)。还支持使用 bef...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
057128
query_posts函数把你的WordPress博客变成CMS-龙网 - 教程、网赚、安全、免费资源

query_posts函数把你的WordPress博客变成CMS

query_posts函数的功能非常强大,只有想不到没有做不到,当你不满足wordpress博客主题的首页时,我们可以通过query_posts函数重新来打造我们的博客首页,可以把它变成一个显示容量强大的CMS主题...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
073119
WordPress函数 get_header()-龙网 - 教程、网赚、安全、免费资源

WordPress函数 get_header()

介绍 包含当前主题目录中的header.php模板文件。 如果指定了名称,则将包含专用的标题头 - {name} .php。 如果主题不包含header.php文件,则将包含默认主题wp-includes/theme-compat/header.php...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
08491
WordPress函数:add_theme_support()让你的主题支持特定的功能-龙网 - 教程、网赚、安全、免费资源

WordPress函数:add_theme_support()让你的主题支持特定的功能

add_theme_support() 用于在我们的当前使用的主题添加一些特殊的功能,函数一般写在主题的functions.php文件中,当然也可以再插件中使用钩子来调用该函数,如果是挂在钩子上,那他必须挂在after...
Seraph的头像-龙网 - 教程、网赚、安全、免费资源钻石会员Seraph7个月前
0104111