Nau'in Post na Musamman tare da Nau'in Al'adu

wordpress

WordPress yana zama irin wannan matattarar dandamali ga kamfanoni da yawa, amma matsakaita kamfani baya amfani da wani ɓangare na ƙarfin. Ofaya daga cikin abokan cinikinmu ya so ya ƙara sashin kayan aiki zuwa rukunin yanar gizon su amma ba ya son yin hakan ta amfani da shafuka ko a cikin rubutun blog. Wannan shine ainihin abin da WordPress ke tallafawa Nau'in Post Na Musamman domin!

A wannan halin, muna son ƙara Sashin Albarkatu zuwa ɗayan rukunin rukunin abokan cinikinmu. Yana da sauƙi mai sauƙi don ƙara a Nau'in Post Na Musamman zuwa ga taken WordPress. Addara lambar mai zuwa ta amfani da aikin yi rijistar_ post_type zuwa ga ayyukan.php shafi:

// Resourcesara Albarkatu Nau'in Rubuta Na Musamman add_action ('init', 'create_post_type'); aiki create_post_type () {register_post_type ('albarkatu', tsararru ('lakabin' => tsararru ('sunan' => __ ('Albarkatun'), 'singular_name' => __ ('Resource'), 'add_new' => __) ('Add New'), 'add_new_item' => __ ('Add New Resource'), 'edit_item' => __ ('Edit Resource'), 'new_item' => __ ('Sabuwar Hanyar'), 'all_items' => __ ('Duk Albarkatun'), 'view_item' => __ ('Duba Albarkatun'), 'search_items' => __ ('Abubuwan Bincike'), 'not_found' => __ ('Ba a samo Albarkatun ba'), 'not_found_in_trash' => __ ('Babu Albarkatu a Shara'), 'parent_item_colon' => '', 'menu_name' => __ ('Resources')), 'jama'a' => gaskiya, 'has_archive' => gaskiya, 'sake rubutawa' => tsararru ('slug' => 'albarkatu'), 'yana goyon bayan' => tsararru ('take', 'edita', 'marubuci', 'thumbnail', 'excerpt', 'comments'))) ; }

Abinda ya fi wahalar samu shine yadda ake yinsa nau'ikan al'ada for your Nau'in Post Na Musamman. Reasonaya daga cikin dalilan da yasa yake da wahalar gano yadda ake yin wannan shine saboda ana kiran sa haraji na al'ada kuma yana amfani da rijista_taxonomy aiki don tsara shi. A wannan yanayin, muna son ƙara nau'ikan albarkatu kamar Webinars, Fuskar Fasaha, da sauransu. Zuwa taken… don haka ga wasu ƙarin lambar don fayil ɗin ayyuka.php:

add_action ('init', 'resource_category_init', 100); // 100 don haka an yi rijistar nau'in aiki aiki resource_category_init () {register_taxonomy ('type', 'resources', array ('labels' => array ('name' => 'Type Type', 'singular_name' => ' Nau'in Bayanai ',' search_items '=>' Nau'in Samfurin Bincike ',' popular_items '=>' Shahararren Kayan Aikin ',' all_items '=>' Duk Nau'in Bayanai ',' edit_item '=> __ (' Shirya Hanyoyin Samun ') , 'update_item' => __ ('Sabunta Hanyar Samun Sabunta'), 'add_new_item' => __ ('Newara Sabon Nau'in Bayanai'), 'new_item_name' => __ ('Sabuwar Hanyar Samun')), 'hierarchical' => 'karya', 'lakabin' => 'Nau'in Albarkatun')); }

Nau'ikan Post na Musamman kuma suna ba ku damar tsara taskar labarai da shafuka guda don nau'ikan Post ɗinku na Musamman. Kawai kwafa fayilolin archive.php da single.php. Sake suna ɗin ɗin tare da Nau'in Post Na Musamman a cikin suna. A wannan yanayin, wannan zai zama archive-resources.php da single-resources.php. Yanzu zaku iya tsara waɗancan shafuka duk da haka kuna son shafin wadatar ya duba.

2 Comments

  1. 1

    Wata hanyar kuma ita ce ta amfani da kayan kwalliya kamar Sauƙin Nau'in Kayan Na'urar Nau'in al'ada ko Nau'in.

    Waɗannan plugins ɗin suna ba ku damar sauƙaƙa ƙara akwatunan meta na al'ada da ƙirƙirar shafi na musamman da samfura na post.

    • 2

      Gaskiya ne sosai @ google-d5279c8b66d25549a0ec3c8dd46a3d1a: disqus! Zan kasance mai gaskiya cewa ina jin kamar wasu abubuwan da aka saka sun hada ton na sama zuwa ga shafin yanar gizo… kuma ba za ku iya kawai motsa jigo daga shafin daya zuwa na gaba ba, dole ne ku tabbatar kun motsa abubuwan karin, suma . Shine kawai dalilin da yasa nake aiki don shigar da ayyukan da suka dace a cikin fayilolin jigo.

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.