我在 wp_posts 表加了自定义的字段 is_essence,0 代表不加精华,1 代表加精华。但是我获取不到用这查询的数据。

我在 wp_posts 表加了自定义的字段 is_essence,0 代表不加精华,1 代表加精华。但是我获取不到用这查询的数据。


正在查看 2 个帖子:1-2 (共 2 个帖子)
  • 作者
    帖子
  • weblog
    参与者
    • 文章数量: 26
    @weblog
    楼主

    在  \WWW\wordpress\wp-content\plugins\bbpress\includes\topics\template.php     146行时有定义

    $default = array(
    ‘post_type’ => bbp_get_topic_post_type(),

    ‘is_essence’ => 1,
    ‘post_parent’ => $default_post_parent, // Forum ID
    ‘meta_key’ => ‘_bbp_last_active_time’, // Make sure topic has some last activity time
    ‘meta_type’ => ‘DATETIME’,
    ‘orderby’ => ‘meta_value’, // ‘meta_value’, ‘author’, ‘date’, ‘title’, ‘modified’, ‘parent’, rand’,
    ‘order’ => ‘DESC’, // ‘ASC’, ‘DESC’
    ‘posts_per_page’ => bbp_get_topics_per_page(), // Topics per page
    ‘paged’ => bbp_get_paged(), // Page Number
    ‘show_stickies’ => $default_show_stickies, // Ignore sticky topics?
    ‘max_num_pages’ => false, // Maximum number of pages to show

    // Conditionally prime the cache for related posts
    ‘update_post_family_cache’ => true
    );

     

    我加了一个 条件 ‘is_essence’ => 1, 怎么一直获取不到只有  ‘is_essence’ =为 1的数据。

    诗语
    管理员
    • 文章数量: 5,866
    @feibisi

    参考这篇帖子吧 https://bbs.weixiaoduo.com/topic/23558

    判断函数也是 WordPress 的。

正在查看 2 个帖子:1-2 (共 2 个帖子)
  • 哎呀,回复话题必需登录。

未找到对应子版块?请直接在 [疑难杂症] 版块中发帖提问。

收藏纪念品


有奖活动

参与论坛社区问答,有机会获赠文派瓦普(Wapuu.com)手办模型。

产品博客


RSS 错误: http://blog.weixiaoduo.com/feed is invalid XML, likely due to invalid characters. XML error: Invalid document end at line 2, column 1

话题信息

商业系统