我最终找到了答案。我安装了wordpress插件;“查询牧马人”;这帮我建立了我想要弄明白的东西。缺少的键不是自定义字段未出现的帖子上的“”值,而是我应该放“0”。
以下是最终工作代码:
$args = array (
\'paged\' => 1,
\'posts_per_page\' => \'-1\',
\'offset\' => 0,
\'post_status\' => array(\'publish\', \'pending\', \'draft\', \'auto-draft\', \'future\', \'private\', \'inherit\'),
\'ignore_sticky_posts\' => 0,
\'orderby\' => \'date\',
\'order\' => \'DESC\',
\'post_type\' => \'speakers\',
\'meta_query\' => array (
0 => array (
\'key\' => \'speaker_promo_image\',
\'value\' => \'0\',
\'compare\' => \'!=\',
\'type\' => \'CHAR\',
),
),
\'meta_key\' => \'speaker_promo_image\',
);