Nā ʻAno Hoʻouna Kūlohelohe me nā ʻĀina Dute

wordpress

Ke lilo nei ʻo WordPress i kahua pono nui i nā ʻoihana he nui, akā ʻaʻole lawe ka ʻoihana awelika i kahi hapa o nā hiki. Ua makemake kekahi o kā mākou mea kūʻai aku e hoʻohui i kahi ʻāpana waiwai i kā lākou pūnaewele akā ʻaʻole makemake e hana ia me ka hoʻohana ʻana i nā ʻaoʻao a i ʻole i nā pou blog. ʻO kēia nō ka mea a WordPress i kākoʻo ai Nā Kūlana Kū Kūhelu no ka mea!

I kēia hihia, makemake mākou e hoʻohui i kahi ʻāpana waiwai i kekahi o nā pūnaewele a kā mākou mea kūʻai aku. He maʻalahi maʻalahi e hoʻohui a Hōʻailona Koho Kūlana i kāu kumuhana WordPress. Hoʻohui ʻoe i kēia code aʻe me ka hoʻohana ʻana i ka hana register_post_type i kāu ʻaoʻao functions.php:

// Hoʻohui i nā kumuwaiwai Custom Post Type add_action ('init', 'create_post_type'); hana hana_post_type () {register_post_type ('kumuwaiwai', hoʻonohonoho ('lepili' => hoʻonohonoho ('inoa' ​​=> __ ('Kumuwaiwai'), 'singular_name' => __ ('Resource'), 'add_new' => __ ('Add New'), 'add_new_item' => __ ('Add New Resource'), 'edit_item' => __ ('Edit Resource'), 'new_item' => __ ('New Resource'), 'all_items' => __ ('All Resources'), 'view_item' => __ ('Nānā Kumuwaiwai'), 'search_items' => __ ('Nā Kumuwaiwai Huli'), 'not_found' => __ ('ʻAʻole ʻIke ʻia nā Kumuwaiwai'), 'not_found_in_trash' => __ ('ʻAʻohe Puna i ʻōpala'), 'parent_item_colon' => '', 'menu_name' => __ ('Resources')), 'public' => ʻoiaʻiʻo, 'has_archive' => ʻoiaʻiʻo, 'rewrite' => hoʻonohonoho ('slug' => 'kumuwaiwai'), 'kākoʻo' => hoʻonohonoho ('inoa', 'hoʻoponopono', 'mea kākau', 'thumbnail', 'excerpt', 'comments')) ; }

ʻO kahi paʻakikī hou aʻe e ʻike pehea e hana ai mahele kuʻuna no kāu Hōʻailona Koho Kūlana. ʻO kekahi kumu no ka paʻakikī e noʻonoʻo pehea e hana ai i kēia no ka mea ua kapa ʻia ia he taxonomy maʻamau a hoʻohana i ka kāinoa_taxonomy hana e hoʻopilikino iā ia. I kēia hihia, makemake mākou e hoʻohui i nā ʻano kumuwaiwai e like me Webinars, Whitepapers, a me nā mea ʻē aʻe i ke kumuhana ... no laila eia kekahi code hou no nā faile function.php

add_action ('init', 'resource_category_init', 100); // 100 no laila ua hoʻopaʻa inoa ʻia ka post post resource_category_init () {register_taxonomy ('type', 'resources', array ('labels' => array ('name' => 'Resource Type', 'singular_name' => ' ʻAno Kumuwaiwai ',' search_items '=>' Nā ʻimi kumu waiwai ',' popular_items '=>' Nā ʻano kumuwauwai kaulana ',' all_items '=>' Nā ʻano kumuwaiwai āpau ',' edit_item '=> __ (' Edit Type Resource ') , 'update_item' => __ ('Update Type Resource'), 'add_new_item' => __ ('Add New Resource Type'), 'new_item_name' => __ ('Type Resource New')), 'hierarchical' => 'false', 'label' => 'ʻAno Kumuwaiwai')); }

ʻAe nā ʻano Custom Post e ʻae iā ʻoe e hoʻolālā i ka waihona a me nā ʻaoʻao hoʻokahi no kāu ʻano Post Kina. E kope wale i nā waihona archive.php a me single.php. Kapa hou i nā kope me ka Hōʻailona Koho Kūlana i ka inoa. I kēia hihia, lilo ia i waihona-kumu waiwai.php a me nā kumuwaiwai hoʻokahi.php. I kēia manawa hiki iā ʻoe ke hoʻopilikino i kēlā mau ʻaoʻao akā makemake ʻoe i ka ʻaoʻao waiwai e nānā.

2 Comments

  1. 1

    ʻO kahi ala ʻē aʻe e hoʻohana ai i kahi plugin e like me nā ʻaoʻao ʻike maʻalahi maʻalahi a i ʻole ʻāpana.

    Hāʻawi kēia mau plugina iā ʻoe e hoʻohui maʻalahi i nā pahu meta maʻamau a hana i kahi ʻaoʻao a me nā template template.

    • 2

      ʻOiaʻiʻo @ google-d5279c8b66d25549a0ec3c8dd46a3d1a: disqus! E haʻi pono wau i koʻu manaʻo e like me kahi mau plugins e hoʻohui i kahi ton o overhead i ka blog ... a ʻaʻole hiki iā ʻoe ke neʻe wale i kahi kumuhana mai kahi pūnaewele a i kahi aʻe, pono ʻoe e hōʻoia e neʻe i nā plugina. . ʻO ia wale nō ke kumu o kaʻu hana e hoʻokomo i nā hana kūpono i nā faila kumuhana.

Pehea kou manaʻo?

Ke hoʻohana nei kēia pūnaewele i ka Akismet e ho'ēmi i ka spam. E aʻo pehea e hanaʻia ai kāuʻikeʻikepili.