Ungasitshintsha njani isitayile somxholo kunye neMixholo yaBantwana kwiWordPress engamashumi amabini anesihlanu

NguLisa Sabin-Wilson

I-WordPress umxholo iqulathe ingqokelela yeefayile zetemplate, istayile, imifanekiso, kunye neefayile zeJavaScript. Umxholo ulawula ubeko kunye noyilo olubonwa ziindwendwe zakho kwindawo leyo. Xa umxholo onjalo umiselwe ngokufanelekileyo njengomxholo womzali, uvumela ifayile ye umxholo womntwana, okanye iseti yemiyalelo, yokubhala ngaphezulu iifayile zayo. Oku kuqinisekisa ukuba umxholo womntwana unokukhetha ngokukhethekileyo ubeko, isitayile kunye nokusebenza komxholo womzali.



Eyona ndlela ikhawulezayo yokuqonda imixholo yomntwana ngumzekelo. Apha, ufumanisa indlela yokwenza umxholo olula womntwana oguqula isimbo somxholo womzali. Okwangoku, umxholo we-WordPress ongagqibekanga ungamashumi amabini anesihlanu.



Umxholo wamashumi amabini anesihlanu.Umxholo wamashumi amabini anesihlanu.

Kusenokwenzeka ukuba unamashumi amabini anesihlanu kwiWebhusayithi yakho yeWordPress, kwaye amashumi amabini anesihlanu ngumxholo womntwana-ulungile; ke ngoko, ngumgqatswa omkhulu wokwenza umzekelo umxholo womntwana.

Ukudala umxholo womntwana

Njengemixholo yesiqhelo, umxholo womntwana kufuneka uhlale kulawulo ngaphakathi/ wp-umxholo / imixholoulawulo. Inyathelo lokuqala lokudala umxholo womntwana kukongeza umkhombandlela oza kuwubamba. Kulo mzekelo, yenza ifayile entshaamashumi amabini anesihlanu umntwanaumkhombandlela ngaphakathi/ wp-umxholo / imixholoulawulo.



khangela isikhombisi sepilisi

Ukubhalisaamashumi amabini anesihlanu umntwanaumkhombandlela njengomxholo kunye nokuwenza umntwana womxholo wamashumi amabini anesihlanu, yenza iisitayile.cssfayile kwaye ungeze izihloko ezifanelekileyo zemixholo. Ukwenza oku, chwetheza le khowudi ilandelayo kwikhowudi yakho oyithandayo okanye kumhleli wombhalo ocacileyo, njengeNotepad (yeWindows) okanye iTextMate (Mac), kwaye ugcine ifayile njengeisitayile.css:

/* Theme Name: Twenty Fifteen Child Description: My magnificent child theme Author: Lisa Sabin-Wilson Version: 1.0 Template: twentyfifteen */

Ngokwesiqhelo, ufumana ezi zihloko zilandelayo kumxholo weWordPress:

  • Igama Lomxholo: Umsebenzisi ongumxholo ubona eli gama ngasemva kweWordPress.



  • Inkcazo: Esi sihloko sinika umsebenzisi naluphi na ulwazi olongezelelweyo malunga nomxholo. Okwangoku, le ntloko ibonakala kuphela kwiphepha lokuLawula imixholo (khetha inkangeleko → Imixholo).

  • Umbhali: Olu luhlu luluhlu ludwelisa umxholo omnye okanye nangaphezulu. Okwangoku, le ntloko iboniswa kuphela Phatha imixholo iphepha (khetha inkangeleko → Imixholo).

    uxinzelelo lwegazi 125/85
  • Inguqulelo: Inombolo yenguqulo iluncedo olukhulu ekugcineni umkhondo weenguqulelo eziphelelwe lixesha zomxholo. Ukuhlaziya inombolo yenguqulo xa uguqula umxholo uhlala ungumbono olungileyo.

  • Itemplate: Le ntloko itshintsha umxholo kumxholo womntwana. Ixabiso lale ntloko lixelela iWindowsPress igama lesikhokelo somxholo womzali. Kuba umzekelo wakho umxholo womntwana usebenzisa amashumi amabini anesihlanu njengomzali, wakhoisitayile.csskufuneka ibe nentloko yeTemplate enexabiso leamashumi amabini anesihlanu.

Sebenzisa umxholo omtsha wamashumi amabini anesihlanu womntwana njengomxholo wakho osebenzayo.

ingakanani i-benadryl inja engayithatha
Umxholo wamashumi amabini aneshumi elinesihlanu woMntwana ongabonakali kakuhle.Umxholo wamashumi amabini aneshumi elinesihlanu woMntwana ongabonakali kakuhle.

Uyabona ukuba umxholo omtsha awubonakali ulungile. Ingxaki kukuba umxholo omtsha womntwana ungene endaweni ye-isitayile.cssifayile yomxholo womzali, ukanti umxholo womntwana omtshaisitayile.cssifayile ayinanto. Unokukopa kwaye uncamathisele umxholo wemixholo yomzaliisitayile.cssfile, kodwa oko kungachitha ezinye zezinto ezinokubakho kwimixholo yomntwana. Endaweni yoko, ufuna ukuguqula kuphela ezo zitayile kunye / okanye izinto ofuna ukuziguqula kwaye uzishiye zodwa.

Ukulayisha umxholo womxholo womzali

Enye yezinto ezintle malunga neeSpredishithi zesitayile seCascading (CSS) yindlela imithetho enokuthi igqithise ngayo. Ukuba udwelisa umthetho ofanayo kabini kwi-CSS yakho, umthetho wokugqibela oza kuqala.

Umzekelo:

a { color: blue; } a { color: red; }

Lo mzekelo ulula kakhulu, kodwa ubonakalisa umxholo kakuhle. Umgaqo wokuqala uthi lonke ikhonkco (ukuyatags) kufuneka iblue, ngelixa owesibini esithi amakhonkco kufuneka abe bomvu. Ngenxa yokuba imigaqo yeCSS ithi umthetho wokugqibela uhamba phambili, amakhonkco aya kuba bomvu.

Usebenzisa eli nqaku leCSS, ungalidla ilifa lonke uhlobo lomxholo womzali kwaye uliguqule ngokukhetha ngaphezulu komgaqo womxholo womzali. Kodwa ungalayisha njani umxholo womntwanaisitayile.cssifayile ukuze ifumane isitayile somxholo womzali?

Ngethamsanqa, i-CSS inenye into ebalulekileyo ekunceda ukuba wenze oku ngokulula. Yongeza nje umgca omnye kumxholo wamashumi amabini aneshumi elinesihlanu womntwanaisitayile.cssifayile:

ukufunxa i-jr yonyawo lwembaleki
/* Theme Name: Twenty Fifteen Child Description: My magnificent child theme Author: Lisa Sabin-Wilson Version: 1.0 Template: twentyfifteen */ @import url(‘../twentyfifteen/style.css’);

Ziliqela izinto eziqhubekayo apha, ke masikhe siyiphule ngamaqhekeza:

  • @import : Oku kuxelela isikhangeli ukuba silayishe enye istayile. Sebenzisa oku kukuvumela ukutsala isitayile somzali ngokukhawuleza nangokulula.

  • url ('...') : Oku kubonisa ukuba ixabiso yindawo kwaye hayi ixabiso eliqhelekileyo.

  • ('../amashumi amabini aneshumi/style.css'); : Le yindawo yesitayile somzali. Qaphela i/ amashumi amabini aneshumi elinesihlanuigama lolawulo. Oku kufuneka kutshintshwe ukuze kuhambelane ne-Itemplate:value kwintloko ye-CSS ukuze isitayile esifanelekileyo sefayile silayishwe.

Emva kokuba uhlaziye indawo yakho, uyabona ukuba uyilo lomxholo womntwana kunye nolwakhiwo ziyahambelana nomxholo wokuqala wamashumi amabini anesihlanu.

i-dimetapp ebandayo kunye nokukhohlela

Ukwenza ngokwezifiso umxholo wesimbo somzali

Umxholo wakho wamashumi amabini anesihlanu woMntwana usetelwe ukuhambelana nomxholo wamashumi amabini anesihlanu omzali. Ngoku ungongeza isitayile esitsha kumxholo wamashumi amabini aneshumi elinesihlanu womntwanaisitayile.cssifayile. Umzekelo olula wokwenza ngokwezifiso imisebenzi yongeza isitayile esiguqula zonke i-h1, i-h2, kunye ne-h3 izihloko zibe ngunobumba omkhulu.

/* Theme Name: Twenty Fifteen Child Description: My magnificent child theme Author: Lisa Sabin-Wilson Version: 1.0 Template: twentyfifteen */ @import url(‘../twentyfifteen/style.css’); h1, h2, h3 { text-transform: uppercase; }

Uyayibona indlela umxholo womntwana ojongeka ngayo nezongezo zesitayile seCSS ezisetyenzisiweyo- ukuba ngcono, akunjalo?

Umxholo womntwana ohlaziyiweyo onesihloko esikhulu.Umxholo womntwana ohlaziyiweyo onesihloko esikhulu.

Njengoko ubona, ngemigca embalwa kwifayile ye-isitayile.cssifayile, unokwenza umxholo omtsha womntwana owongeza ngokwezifiso ezithile kumxholo okhoyo. Ayikhawulezi nje kwaye kulula ukuyenza, kodwa akufuneki uguqule nantoni na kumxholo womzali ukuze usebenze.