Skip to main content

He aha te whakamahi o ngā snippets Ultimate Multisite i tō repository GitHub

He snippet (code) mō te pūtaiao e tino whai te whakamahi e ngā mea e whai i Ultimate Multisite, ko te mea he tino whai te hiahia i te whakamahi i āhuatanga iti, ahau e whakaatu ana i te mea he te whakamahi o script Google Analytics ki ngā puta mai (sign-up pages) me te whakaatu i te meta box (meta box) mō te admin dashboard.

Ko tēnei article e whakaatu atu ana i a koe i te whakamahi, ahau e whakaatu atu ana i a koe i te wāhi tino tika kia whae i ngā kōrero he mea nui.

Ko e taea e koe te mātakitaki i ngā snippets i te link i runga i runga:

https://github.com/next-press/wp-ultimo-snippets/

He wahi rua mo te whakamahi i tēnei code:

  1. I te file functions.php o tō theme.

  2. Must-Use Plugins (mu-plugins)

He aha te whakamahi i te snippet ki te file functions.php o tō theme.

  1. Whakawhiti atu ki te admin dashboard o tō WordPress Network me wahi Themes > Theme Editor (Mā te whakaahua i runga i).

  2. I te puta mai o te "Edit Themes", kia kore eke koe ki te dropdown field, kia whai i tō theme e tika ana i te wāhi nui i te tupu pōuri o tō whero (screenshot #3 i runga i).

  3. Whakawhiti atu ki te file functions.php i roto i te chine "Theme Files" kia whakauru i tēnei file. Whakarongo ki te tūpuna i te tūpuna, ā, whae i te Ultimate Multisite snippet he paku mai i GitHub repository.

He aha te whakamahi o Must-Use Plugins (mu-plugins)

He āhuatanga o WordPress e hiahia ana ki a koe kia whakauru āhuatanga mō te tino whai, ko "Must-Use Plugins", ahau e whakatō i te ingoa "mu-plugins" he mea nui.

Ko ngā mu-plugins he tino whai, he whakauru i te wae pūrere (plugin) katoa, me kei te taea te whakahoki ki te whakatika (deactivate). I te multisite network, ko te code i ngā mu-plugins ei te whakamahinga i ngā wāhi katoa i tō installation.

  1. Whakawhiti atu ki FTP he tino pūrere (SSH) mō te whai i te filesystem o tō WordPress install.

  2. I roto i te directory wp-content o te WordPress mo te install, whakawhiti atu i te whakamahi i te directory hou named: mu-plugins.

  1. Whakawhiti atu i tētahi file PHP hou ki te wāhi mo tekompono o koe (computer) named wu-snippet.php, he whakamahi Notepad ana he aua editor kōkōrero.

  2. Whakarite i te snippet o Ultimate Multisite e pēnei i te GitHub repository kua feti atu ki te file, ā, whai whakaaro ki te save i tō mahi. Kei te tika ana hoki koe ki te whāhi i tēnei code i runga i te snippet kia whakatakino i tō mu plugin.