Aara Alamar Gida zuwa Menu na Kewayawa na WordPress

menu na gida

Muna son WordPress kuma muna aiki dashi kusan kowace rana. Tsarin menu wanda ke aiki a cikin WordPress abin birgewa ne - kyakkyawar alama ce mai jan hankali da sauƙi mai sauƙin amfani. Idan takenku bashi da ɓangaren menu inda zaku iya canza menus ɗinku, kuna buƙatar nemo sabon mai haɓakawa!

Tare da ƙarin kayanmu na Ajax, ina so in rage girman haɗin gidan a kan menu na kewayawa kuma kawai sanya gunkin gida. Anara gunki ba zaɓi bane ta hanyar WordPress, kodayake, don haka dole ne mu ƙara aiki ta hanyar fayil ɗinmu na function.php. Na sami yanki guda ɗaya akan layi don ƙara haɗin gidan zuwa menuKawai sai na canza shi don amfani da ainihin hoto maimakon hanyar haɗin rubutu.

Sanya Alamar Gida zuwa WordPress

add_filter ('wp_nav_menu_items', 'add_home_link', 10, 2); aiki add_home_link ($ abubuwa, $ args) {idan (is_front_page ()) $ class = 'class = "current_page_item home-icon"'; sauran $ class = 'class = "gida-icon"'; $ homeMenuItem = ' '. $ args-> kafin. ` `. $ args-> mahada_kafun. ''  '. $ args-> mahada_ bayan haka. ` `. $ args-> bayan. '' '; $ abubuwa = $ homeMenuItem. abubuwa $; dawo da abubuwa $; }

Wannan lambar tana ƙara aji zuwa hoton kuma don ku daidaita yanayin wurin ta hanyar tsarin salo.

daya comment

  1. 1

Me kuke tunani?

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