Easy Primary Category

توسط

Notice: Currently works only with WordPress Classic Editor, not Gutenberg compatible

Allows you to choose primary category for posts and custom post types.

When the permalink structure includes category, the category marked as Primary, will be used for generating the permalink of the post.

Works with custom post types and custom taxonomies as long as the taxonomy supports hierarchical structure.

  1. Add the plugin’s folder in the WordPress’ plugin directory.
  2. Activate the plugin.
  3. Now you will have the ability to make any category a primary category for the post

سوالات متداول

Why I can’t see the “Make Primary” button?

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.

Developers’ Notes

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',
) );
}

How can I contribute?

Want to contribute to Easy Primary Category? That would be awesome!
1. Reporting bugs or asking questions
2. Submitting Pull Requests
3. Translating in your own language

×
نظری برای این آیتم موجود نیست.
0 0 رای ها
امتیازدهی
اشتراک در
اطلاع از
0 نظرات
قدیمی‌ترین
تازه‌ترین بیشترین رأی
نسخه حجم فایل SHA256 تغییرات دانلود
1.1.1 20 کیلوبایت -
دانلود
×
★★★★★
★★★★★
5.0 /5 (4 نظر)

قیمت:

رایگان

نگارش

1.1.1

آخرین انتشار

14 اردیبهشت 1405

آخرین بروزرسانی

3 ماه پیش

نصب های فعال

1,000+

نگارش وردپرس

وردپرس 4.5+

تست شده از نسخه

وردپرس 6.9.4

نگارش PHP

PHP 5.6+

تگ ها

نسخه ها

1 نسخه