1
我想顯示custom post type ='product'
如果它在WordPress管理部分metakey='child'
:過濾WordPress郵寄由metavalue
我用下面的方法,但還沒有產品後顯示。
add_filter('posts_where' , 'posts_where_statement');
$where = "AND wp_postmeta.metakey LIKE 'child' AND wp_posts.post_type = 'product' ";
AND wp_posts.post_type = 'product' // This works just fine
AND wp_postmeta.metakey LIKE 'child' // This doesn't work!
請幫我在這一個。謝謝。
可能重複[WordPress的 - 基於元字段內容獲取後(http://stackoverflow.com/questions/11068795/wordpress-get-post-based-on-meta-field-content) – DACrosby
嘗試'和wp_postmeta.metakey LIKE'%child%'' – Ghost