开发者 | gagan0123 |
---|---|
更新时间 | 2023年5月27日 17:03 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.2.2 |
版权: | GPLv2 |
版权网址: | 版权信息 |
The button is displayed only when more than one category is selected, try assigning other categories to the post, as soon as there's more than one category selected, the "Make Primary" button will appear.
If you want to fetch posts belonging to a particular term you can use this:
if ( function_exists( 'epc_get_primary_term_posts' ) ) {
/**
* Assuming you want to fetch 10 published posts which have category ID 2
* marked as primary category
*/
$posts = epc_get_primary_term_posts( 2, array(
'post_status' => 'publish',
'posts_per_page' => 10,
'post_type' => 'post',
) );
}
Want to contribute to Easy Primary Category? That would be awesome!