WordPress 声音、音频主题 JSounds。

主要功能
- 自定义标签排序
- 男女分类中搜索对应分类的音频
- ABCS类筛选
- 手机自适应
- 支持多重标签、自定义文字搜索。
WordPress 声音、音频主题 JSounds。


WordPress插件/主题开发中,如何获取文章发表用户的ID ?
官方文档:
get_the_author_meta( string $field = '', int|false $user_id = false )Retrieves the requested data of the author of the current post.
Valid values for the $field parameter include:
$field
(string) (Optional) The user field to retrieve.
Default value: ”$user_id
(int|false) (Optional) User ID.
Default value: false
(string) The author’s field from the current author’s DB object, otherwise an empty string.
$author_id = get_post_field ('post_author', get_the_ID() );
近日我们在改版 WordPress 采集插件 wp-jpost , 将代码内容进行重构,我们尽量使用 WordPress 原生的代码来做。
当我们在插件开发中使用 register_post_type 函数来自定义文章类型(wordpress使用register_post_type 函数创建自定义文章类型)时,可能需要 register_taxonomy 来注册一个对应的分类,但是我们这里想使用原生的 分类时,一开始我们使用了 add_meta_box (WordPress函数:add meta box(自定义添加Meta模块))的 post_categories_meta_box 来进行注册。
但是后台可以正常显示,但是保存数据时并不能将分类数据保存下来,后来我们查阅相关文档之后发现必须使用 register_taxonomy_for_object_type 函数来调用。同样的标签类型也可以使用。
<?php
add_action( 'init', 'jiloc_add_page_cats' );
function jiloc_add_page_cats(){
$slug = "jiloc";
register_taxonomy_for_object_type( 'category', $slug );
register_taxonomy_for_object_type( 'post_tag', $slug );
}
WordPress函数:register post type (自定义文章类型)用法和范例 , 在这篇文章中我们进行了详细的记载。