Mitundu Yotumiza Mwambo ndi Magulu Atsopano

WordPress

WordPress ikukhala nsanja yofunikira kwambiri kumakampani ambiri, koma kampani wamba imagwiritsa ntchito mwayi wocheperako. Mmodzi mwa makasitomala athu amafuna kuwonjezera gawo lazinthu patsamba lawo koma sanafune kutero pogwiritsa ntchito masamba kapena zolemba muma blog. Izi ndizomwe WordPress imathandizira Mitundu Yaposachedwa chifukwa!

Poterepa, timafuna kuwonjezera Chigawo Chothandizira pa tsamba limodzi la makasitomala athu. Ndiosavuta kuwonjezera fayilo ya Mtundu Waposachedwa ku mutu wanu wa WordPress. Mukuwonjezera nambala yotsatira pogwiritsa ntchito ntchitoyi kulembetsa_post_type patsamba lanu la works.php:

// Onjezani Zowonjezera Mtundu Wosintha Mtundu add_action ('init', 'create_post_type'); ntchito create_post_type () {register_post_type ('resources', array ('labels' => array ('name' => __ ('Resources'), 'singular_name' => __ ('Resource'), 'add_new' => __ ('Add New'), 'add_new_item' => __ ('Onjezerani Zida Zatsopano'), 'edit_item' => __ ('Sinthani Zida'), 'new_item' => __ ('Resource New'), 'all_items' => __ ' 'not_found_in_trash' => __ ('Palibe Zowonjezera mu Zinyalala'), 'parent_item_colon' => '', 'menu_name' => __ ('Resources')), 'public' => zowona, 'has_archive' => zowona, 'rewrite' => mndandanda ('slug' => 'zothandizira'), 'zogwirizira' => mndandanda ('mutu', 'mkonzi', 'wolemba', 'thumbnail', 'excerpt', 'comments'))) ; }

Chovuta kupeza ndi momwe mungapangire Magulu azikhalidwe wanu Mtundu Waposachedwa. Chifukwa chimodzi chomwe chimakhalira kovuta kudziwa momwe mungachitire izi ndi chifukwa amatchedwa taxonomy ndipo amagwiritsa ntchito kulembetsa_chuma ntchito kusintha izo. Poterepa, tikufuna kuwonjezera mitundu yazinthu monga Webinars, Whitepapers, ndi zina pamutuwu ... nayi nambala yowonjezera ya fayilo ya works.php:

add_action ('init', 'gwero_category_init', 100); // 100 kotero mtundu wa positi udalembetsedwa ntchito resource_category_init () {register_taxonomy ('type', 'resources', array ('labels' => array ('name' => 'Resource Type', 'singular_name' => ' Mtundu Wothandizira ',' search_items '=>' Mitundu Yofufuzira ',' popular_items '=>' Mitundu Yotchuka Kwambiri ',' all_items '=>' Mitundu Yonse Yothandizira ',' edit_item '=> __ (' Sinthani Mtundu Wothandizira ') " 'zabodza', 'label' => 'Mtundu Wothandizira')); }

Mitundu Yachikhalidwe Yotsimikiziranso imakulolani kuti mupangire zosungidwazo ndi masamba osakwatiwa amtundu wanu wamtundu wa Post. Ingokopani za archive.php ndi mafayilo a single.php. Sinthani makopewo ndi Mtundu Waposachedwa m'dzina. Poterepa, ikadakhala archive-resources.php ndi single-resources.php. Tsopano mutha kusintha masamba amenewo momwe mumafunira kuti tsamba lazinthu liwoneke.

2 Comments

  1. 1

    Njira ina ingakhale kugwiritsa ntchito pulogalamu yowonjezera ngati Mitundu Yosavuta Yopezeka kapena Mitundu.

    Mapulaginiwa amakuthandizaninso kuti muwonjezere mosavuta meta mabokosi ndikupanga masamba azikhalidwe ndi ma templates.

    • 2

      Zowona kwambiri @ google-d5279c8b66d25549a0ec3c8dd46a3d1a: disqus! Ndikhala woonamtima kuti ndimamva ngati mapulagini angapo akuwonjezera pamutu pa blog… ndipo simungangosuntha mutuwo kutsamba limodzi kupita kwina, muyenera kuonetsetsa kuti mwasunthanso mapulagini . Ndi chifukwa chokha chomwe ndimagwirira ntchito kuti ndizike ntchito zofunikira m'ma fayilo amutu.

Mukuganiza chiyani?

Tsambali likugwiritsa ntchito Akismet kuchepetsa spam. Phunzirani momwe deta yanu ikufotokozera.