WordPress: lembani Shortcode kuchokera pamutu wa makolo mu mutu wa mwana wanu

WordPress API

Papita kanthawi kuchokera pomwe ndagawana maupangiri pa mapulogalamu mu WordPress. Posachedwa, ndabwerera pa benchi ndikukhazikitsa nambala yamakasitomala athu onse ndipo zakhala zosangalatsa kubwerera kuzinthu zosintha. Mwinamwake mwawona kuphatikiza kwatsopano kwa Kutsatsa Kwapaofesi patsamba lonselo - zomwe zinali ntchito yosangalatsa!

Lero, ndinali ndi vuto lina. Makasitomala athu ambiri amakhala ndi mabatani omwe akukhazikitsidwa kudzera munjira zazifupi za mutu wa makolo. M'modzi mwa anzathu ku Elevated Marketing Solutions adafunsa ngati tingathe kutsatira zochitika pamabatani popeza anali abwino kuchitapo kanthu patsamba lonselo. Mabatani amafupikitsidwe achabechabe kuposa chizindikiritso cha nangula chomwe chimapangidwa bwino kwambiri pogwiritsa ntchito magulu angapo omwe amakhala ndi njira zazifupi.

Chifukwa cha ichi, tinafunika kuwonjezera chojambulidwa pa lemba kuti tilembetse chochitika. Nazi momwe zingawonekere:

Bulu Lanyumba

Vuto, kumene, ndikuti pali njira yachidule m'malo mwathu mutu wa makolo ndipo sitikufuna kusintha mutu wamakolo. Ndipo, popeza shortcode imagwiritsidwa ntchito popezeka patsamba lonselo, sitifunanso kupanga shortcode yatsopano.

Yankho lake ndi lokongola kwambiri. Pulogalamu ya WordPress API limakupatsani kuchotsa shortcode! Chifukwa chake, pamutu wathu wamwana, titha kuchotsa njira yachidule, kenako nkuisintha ndi ntchito yathu yatsopano:

add_action ('after_setup_theme', 'kuyitana_child_theme_setup');
ntchito kuyitana_child_theme_setup () {remove_shortcode ('old_button_function_in_parent_theme'); add_shortcode ('batani', 'new_button_function_in_child_theme'); }
ntchito new_button_function_in_child_theme ($ atts, $ content = null) {... shortcode yanu yatsopano ili pano ...}

Muntchito yanga yatsopano ya batani (mu Child Theme's works.php) yanga, ndalembanso ntchito ya shortcode kuti ikwaniritse chochitika champhamvu paClick. Zotsatira zake zimagwira ntchito bwino ndipo tsopano zikutsatira mu Google Analytics!

Mukuganiza chiyani?

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