वर्डप्रेस फ़ंक्शन the_category एक अतिरिक्त पैरामीटर प्रदान नहीं करता है। यह करता है:
function exclude_post_categories($excl='', $spacer=' ') ( $categories = get_the_category($post->ID); if (!empty($categories)) ( $exclude = $excl; $exclude = explode(",", $exclude); $thecount = count(get_the_category()) - count($exclude); foreach ($categories as $cat) ( $html = ''; if (!in_array($cat->cat_ID, $exclude)) ( $html .= 'cat_ID) . '" '; $html .= 'title="' . $cat->cat_name . '">' . $cat->cat_name . ''; if ($thecount > 0) ( $html .= $spacer; ) $thecount--; echo $html; ) ) ) )
इसके अलावा जब तक आपके पास वह है, तब भी आप आउटपुट को बदल सकते हैं लेकिन आप जो चाहते हैं वह अच्छा है।
उपयोग की तरह है:
जो 4 की आईडी के साथ एक को छोड़कर सभी श्रेणियों को सूचीबद्ध करेगा।