WordPress

Labaatan iyo labaatan: Hordhac Mawduuca Cusub ee WordPress

Twenty Twenty waa mawduuca WordPress-ka ah ee cusub ee la socda sii deynta ugu dambeysay ee WordPress 5.3. Sida kii ka horreeyay labaatan iyo sagaal iyo toban, Twenty Twenty ayaa loo naqshadeeyay iyada oo si gaar ah diiradda loo saarayo Gutenberg. Farqi weyn ayaa u dhexeeya labada, inkastoo: Labaatan iyo labaatan aan laga dhisin dhulka kor; waxaa loo qaabeeyey mawduuc jira oo ka socda bulshada WordPress.

Mar haddii aan jecelnahay wax walba oo ku saabsan WordPress, waxaan si dhow u eegnay mawduuca labaatan iyo labaatanka cusub, anagoo eegayna faylka function.php, xaashida qaabka, iyo qaab-dhismeedka.

Xitaa haddii Twenty Twenty ay ka fog tahay inay yara xasilloonaato - wakhtiga qoraalkan - oo ay jiraan arrimo badan oo aan weli la hagaajin, maanta waxaan kula wadaagi doonaa fikradahayaga ugu horreeya ee ku saabsan mawduuca cusub ee WordPress.

Aynu u dhex galno mawduuca labaatanaad ee WordPress!

Horudhac labaatan iyo labaatan
Labaatan iyo labaatan horudhac mawduuca WordPress ah (Isha sawirka: Samee WordPress Core)

Hordhac degdeg ah oo ku saabsan mawduuca labaatanka

Labaatan iyo labaatan ayaa lagu dul dhisay Chaplin, oo ah mawduuc WordPress ah oo bilaash ah oo uu leeyahay Anders Norén oo sidoo kale ah Hoggaanka Naqshadaynta Mawduuca Default ee WordPress 5.3.

Chaplin ayaa diyaar u ah in lagu soo dejiyo kaydka WordPress.org, sida uu qabo Anders, waxaa la dhisay iyadoo maskaxda lagu hayo tafatiraha Block:

Chaplin waa mawduuc ka kooban qaab WordPress ah kaas oo ku siinaya koontarool buuxa oo ku saabsan xarfaha HTML iyo midabada boggaaga. Waxaa laga dhisay xagga hoose iyadoo maskaxda lagu hayo Tifaftiraha cusub ee Block waxayna sahlaysaa in la abuuro muuqaallo muuqaal ah oo wanaagsan oo ku yaal boggaga iyo boggaga labadaba.

Chaplin WordPress theme
Chaplin WordPress theme

Isla falsafada ayaa ka danbeysa labaatan iyo labaatan: dabacsanaanta, caddayn, iyo akhrinta waa ereyada diirada saaraya mawduuca cusub.

Twenty Twenty waxay la socotaa hal qaab oo tiir ah iyo saddex bog/bog bogag ah, ujeedaduna tahay in la siiyo maamulayaasha WordPress iyo naqshadeeyayaasha Xorriyadda ay ku abuuraan qaab-dhismeedkooda si toos ah ee Tifaftiraha Block Adoo ka faa'iidaysanayna si ballaaran oo buuxa oo leh isku dhejinta walxaha xannibaya sida tiirarka, sawirada, iyo kooxda block ee lagu soo bandhigay Gutenberg 5.5.

Sida Anders uu sharaxay:

Twenty Twenty waxaa loogu talagalay iyada oo udub dhexaad u ah dabacsanaan. Haddii aad rabto inaad u isticmaasho urur ama ganacsi, waxaad isku dari kartaa tiirarka, kooxaha, iyo warbaahinta oo leh jaangooyo ballaaran oo buuxa si aad u abuurto naqshado firfircoon si aad u muujiso adeegyadaada ama alaabtaada. Haddii aad rabto inaad u isticmaasho blog-dhaqameed, tiirka nuxurka udub dhexaad u ah ayaa ka dhigaya mid taas ku habboon sidoo kale.

Taas ka sokow, Labaatan Twenty waxay la socotaa far cusub: Inter. Waa xarfo bilaash ah oo furan qoyska uu naqshadeeyay Rasmus Andersson si gaar ah loogu akhrin karo qoraallada kiis-isku-dhafka ah iyo kuwa yar-yar, gaar ahaan cabbirrada farta yaryar.

Nooca interneedka
Interface qoyska

Inter waxay siisaa shakhsiyad xoogan madaxyada waaweyn, laakiin waxaad ka heli doontaa inta ugu badan markaad u adeegsaneyso cabbirada qoraalka beddelka ah, sida ku cad dulmarka mawduuca laga soo bilaabo barta blog-ka ee WordPress.org:

labaatan iyo labaatan on desktop
Labaatan iyo labaatan qoraal qoraal: saamayn iyo akhrin

In ka badan mawduuc si buuxda u sifaysan, Labaatan Twenty waa mawduuc tilmaamaya tallaabo cusub oo muhiim ah oo loo qaaday horumarka mustaqbalka ee tafatirka UI ee WordPress. Twenty Twenty asal ahaan waxay ku tiirsan tahay Tifatiraha Block si uu u tafatiro loona dejiyo waxa ku jira, iyo Mawduuca Customizer-ka ee madaxa, cagta, iyo habaynta dheeraadka ah.

Iyadoo taas la yiraahdo, waa waqtigii aan ku rakibi lahayn mawduucan WordPress oo aan socodsiinno.

Sida loo rakibo labaatan iyo labaatan

Mawduuca caadiga ah ee soo socda ayaa raaci doona qorshaha sii deynta WordPress 5.3. Tani waxay ka dhigan tahay, wakhtiga qoraalkan, labaatan iyo labaatan ayaan weli diyaar u ahayn soo dejinta WordPress Theme Hagaha.

Si kastaba ha noqotee, waxaad soo dejisan kartaa nooca horumarka ee labaatanaad ee GitHub oo ku rakib nooca hadda deggan ee WordPress ama waxaad ku heli kartaa WordPress 5.3. Kaydka Github waa la burin doonaa marka dulucda la isku daro. Dhanka kale, waxaa laga yaabaa inaad rabto inaad kaydiso taariikhaha soo socda jadwalka sii deynta WordPress 5.3:

  • Sebtember 23, 2019: Beta 1
  • Sebtember 30, 2019: Beta 2
  • Oktoobar 7, 2019: Beta 3
  • 15ka Oktoobar 2019: Musharaxa la siidaayo 1
  • 22ka Oktoobar 2019: Musharaxa la siidaayo 2
  • 29ka Oktoobar 2019: Musharaxa la siidaayo 3
  • 5 Noofambar 2019: Siideynta musharaxa 4 (haddii loo baahdo)
  • 12 Noofambar 2019: Taariikhda la beegsanayo siideynta WordPress 5.3.

Si aad ugu bilowdo labaatan iyo labaatan, raac tillaabooyinka hoose:

  1. Ka hel xirmada sibka GitHub.
  2. U soo rar faylka sibka ku rakibida horumarkaaga dashboardka WordPress ama SFTP.
  3. Uxoogso Muuqaalka mes Dulucda oo guji bogga Guddi badhanka sawirka horudhaca mawduuca.
  4. Tag Muuqaalka → Habbee si loo habeeyo labaatan iyo labaatan.

Waana taas! Waxaad hadda bilaabi kartaa inaad imtixaanadaada ku socodsiiso mareegtaada diyaarinta ama deegaanka deegaankaaga.

Muhiim

Labaatan iyo labaatan ayaa hadda socda oo arrimo badan oo aan weli la hagaajin. Waa inaadan u isticmaalin wax soo saarka.

Labaatan iyo labaatan: qaab ballac buuxa ah
Arrin furan GitHub

Hadda oo aad diyaar u tahay inaad tagto, aan dhaqaaqno oo aan quuso Labaatan iyo labaatan Mawduuca WordPress.

Si fudud u tijaabi mawduucyada WordPress ka hor inta aanad u riixin wax soo saarka adigoo isticmaalaya hal-guji goobaha diyaarinta. Isku day Behmaster bilaash.

“}” data-sheets-userformat='{“2″:6659,”3”:{“1″:0},”4”:{“1″:2,”2″:16777215},”12″:0,”14”:{“1″:2,”2″:0},”15″:”Roboto, RobotoDraft, Helvetica, Arial, sans-serif”}’>

Si fudud u tijaabi mawduucyada WordPress ka hor inta aanad u riixin wax soo saarka adigoo isticmaalaya hal-guji goobaha diyaarinta. Isku day Behmaster bilaash.

Tilmaamaha Mawduuca Labaatanka iyo labaatanka

Twenty Twenty maaha mawduuc WordPress si buuxda u sifaysan, laakiin duluc hoose oo dulucda ugu yar ee ujeedadiisu tahay in la siiyo horumariyeyasha iyo maamulayaasha goobta xorriyadda ay ku dhistaan ​​naqshado gaar ah oo loogu talagalay qoraaladooda iyo bogaggooda. Sida Twenty Nineteen, Twenty Twenty ayaa loo dhisay Gutenberg waxayna inta badan ku xidhan tahay meertada nolosha Gutenberg (wax badan oo ku saabsan mawduucan muuqaalkan Matt Mullenweg ee WCEU 2019).

Mawduucani waxa uu taageeraa tiro ka mid ah sifooyinka mawduucyada sida ballaca nuxurka (580Xidhiidhiyayaasha quudinta tooska ah, sawir-gacmeedka dhejiska, summada cinwaanka, iyo dhowr walxood oo HTML5 ah (foomka raadinta, foomka faallooyinka, liiska faallooyinka, gallery, iyo qoraal kooban).

Astaamaha kale waxay ku daraan xulashooyinka Mawduuca Customizer. Kuwaas waxaa ka mid ah asalka caadiga ah iyo astaanta gaarka ah. Qodobbada koodka hoose waxay muujinayaan sifooyinkan oo karti u yeeshay faylka hawlaha mawduuca:

// Custom background color
add_theme_support(
	'custom-background',
	array(
		'default-color'	=> 'F5EFE0'
	)
);
// Custom logo
add_theme_support(
	'custom-logo',
	array(
		'height'      => 240,
		'width'       => 320,
		'flex-height' => true,
		'flex-width'  => true,
		'header-text' => array( 'site-title', 'site-description' ),
	)
);
Habbiyaha Mawduuca ee Labaatan iyo labaatan
Habbiyaha Mawduuca ee Labaatan iyo labaatan

Twenty Twenty waxay kaloo taageertaa qaar ka mid ah sifooyinka gaarka ah ee Gutenberg. Marka hore, dulucdu way taageertaa toosin ballaaran oo ballaaran:

// Add support for full and wide align images.
add_theme_support( 'align-wide' );

The palette midabka tifaftiraha waa la damci karaa haddii isticmaaluhu uu dejiyo midabka lahjadda ee Customizer-ka (lagu hawlgeliyay default):

// If we have accent colors, add them to the block editor palette
if ( $editor_color_palette ) {
	add_theme_support( 'editor-color-palette', $editor_color_palette );
}
Ku habeynta midabada Labaatan
Ku habeynta midabada Labaatan

Dulucda labaatan iyo labaatanka waxa ay la socotaa afar cabbirada farta tifaftiraha laga heli karo Tifaftiraha Block:

// Gutenberg Font Sizes
add_theme_support( 'editor-font-sizes', array(
	array(
		'name' 		=> _x( 'Small', 'Name of the small font size in Gutenberg', 'twentytwenty' ),
		'shortName' => _x( 'S', 'Short name of the small font size in the Gutenberg editor.', 'twentytwenty' ),
		'size' 		=> 16,
		'slug' 		=> 'small',
	),
	array(
		'name' 		=> _x( 'Regular', 'Name of the regular font size in Gutenberg', 'twentytwenty' ),
		'shortName' => _x( 'M', 'Short name of the regular font size in the Gutenberg editor.', 'twentytwenty' ),
		'size' 		=> 18,
		'slug' 		=> 'regular',
	),
	array(
		'name' 		=> _x( 'Large', 'Name of the large font size in Gutenberg', 'twentytwenty' ),
		'shortName' => _x( 'L', 'Short name of the large font size in the Gutenberg editor.', 'twentytwenty' ),
		'size' 		=> 24,
		'slug' 		=> 'large',
	),
	array(
		'name' 		=> _x( 'Larger', 'Name of the larger font size in Gutenberg', 'twentytwenty' ),
		'shortName' => _x( 'XL', 'Short name of the larger font size in the Gutenberg editor.', 'twentytwenty' ),
		'size' 		=> 32,
		'slug' 		=> 'larger',
	),
) );
Cabbirrada xarfaha ee block-ka tifaftiraha goobaha qoraalka
Cabbirrada xarfaha ee block-ka tifaftiraha goobaha qoraalka

Waana taas. Mawduuca waa mid aad u yar sidoo kale shaqeyntiisa, laakiin si sahlan ayaa loo kordhin karaa mawduuca ilmaha, waxaanan ku dhex quusi ​​doonnaa taas hal daqiiqo gudaheed.

Sida Loo Hagaajiyo Muuqaalka Labaatan iyo Labaatan

Twenty Twenty waxay ka timaadaa bilaash wax kasta oo gambaleel ah iyo foori laakiin waxay siisaa dabacsanaan weyn marka loo isticmaalo tandem ee Gutenberg (ama leh bog dhise wanaagsan).

Habaynta Mawduuca Labaatan iyo labaatanka

The Aqoonsiga Goobta waxay gacanta ku haysaa cinwaanka goobta iyo khadadka summada, astaanta, iyo astaanta. Waxaad awood u yeelan kartaa / dami kartaa dhammaan walxahan ku jira Aqoonsiga Goobta qaybta Customizer:

Aqoonsiga goobta ee goobaha Customizer's
Aqoonsiga goobta ee goobaha Customizer's

Customizer's Dabool Template qaybta waxay qabataa habaynta habaynta ee Dabool Template qaabka bogga. Halkaas, waxaad ka heli doontaa:

  • Ikhtiyaar lagu suurtagelinayo saamaynta isbar-bar-dhigga ee sawirka gadaasha (Sawirka Dhabarka go'an).
  • Midab doorayaasha si ay u dejiyaan midabkaaga asalka caadadii iyo midabka qoraalka ee dulsaarada sawirka.
  • slider si loo xakameeyo mugdiga dulsaaran.
Qaybta Cover Template ee ku taal Customizer
Qaybta Cover Template ee ku taal Customizer

The Ambiyada qaybta waxay bixisaa shan goobood oo menu. Waxaad ku dari kartaa liiska jiifka caadiga ah ee madaxa (Menu Horizontal Desktop) iyo/ama menu navigation la rogi karo (Menu La Balaadhiyay Desktop). The Liiska Mobiilka waa menu gaar ah oo loogu talagalay aaladaha mobilada, iyo Liiska Footer iyo Liiska bulshada waxay ku yaalaan bogga cagta.

Goobaha liiska ee labaatan iyo labaatan
Goobaha liiska ee labaatan iyo labaatan

Cagtu waxa ay gacanta ku haysaa Menu-ga Footer-ka iyo goobaha Menu-ga Bulshada oo ay la socoto laba goobood oo widget ah. Sawirka soo socdaa waxa uu tusinayaa dulucda mawduuca iyada oo dhammaan walxaheeda ay meesha yaalliin:

Qaabka cagta ee labaatanaad
Qaabka cagta ee labaatanaad

Ugu dambeyn, CSS dheeraad ah qaybta waxay kuu ogolaaneysaa inaad ku darto qaababkaaga gaarka ah.

Qaababka Boostada/Bogga Keliya

Marka ay timaado in la dhejiyo iyo qaabaynta bogga, waxaad ka dooran kartaa saddex qaab oo kala duwan. Marka laga reebo qaabka caadiga ah, labaatan iyo labaatan waxay bixisaa a Qaabka daboolka iyo a Qaabka Balaadhka Buuxa waad la ciyaari kartaa si aad u habayso muuqaalka iyo dareenka waxa ku jira.

Hababka Boostada/Bogga Keliya ee Labaatan iyo Labaatan
Hababka Boostada/Bogga Keliya ee Labaatan iyo Labaatan

Tifaftiraha Block ee labaatan iyo labaatan

Habka ugu yar awgeed, muuqaalka Twenty Twenty wuxuu inta badan ku tiirsan yahay Tifaftiraha Block. Waxaan ku wadnaa imtixaanadayada labaatan iyo labaatan oo aan ku wadno nooca Gutenberg 6.4.0. Noocani waxa uu bixiyaa tiro wanaagsan oo astaamo cusub ah, wanaajin, iyo hagaajin kutaan oo si weyn u wanaajiyay khibrada tafatirka.

Si fudud u tijaabi mawduucyada WordPress ka hor inta aanad u riixin wax soo saarka adigoo isticmaalaya hal-guji goobaha diyaarinta. Isku day Behmaster bilaash.

“}” data-sheets-userformat='{“2″:6659,”3”:{“1″:0},”4”:{“1″:2,”2″:16777215},”12″:0,”14”:{“1″:2,”2″:0},”15″:”Roboto, RobotoDraft, Helvetica, Arial, sans-serif”}’>

Si fudud u tijaabi mawduucyada WordPress ka hor inta aanad u riixin wax soo saarka adigoo isticmaalaya hal-guji goobaha diyaarinta. Isku day Behmaster bilaash.

Baloogyada qaar ayaa anfacaya, gaar ahaan marka la dhisayo shabakado hal bog ah. Blocks sida Warbaahinta & Qoraalka iyo cover waa la hagaajiyay oo hadda u muuqda mid aad u wanaagsan marka ay timaado soo bandhigida alaabada iyo/ama faylalka xirfadeed:

warbaahinta iyo qoraalka
Warbaahinta & Qoraalka xannibaadda (oo si buuxda u toosan)

Weli, sida Gutenberg waa shaqo ku socota mashruuca, waxaa laga yaabaa inaad rabto inaad eegto qaar ka mid ah plugins-yada ugu caansan ee u oggolaanaya in lagu daro blocks badan tifaftiraha.

Halkan waxaa ah liis degdeg ah oo plugins ah oo laga yaabo inay mudan tahay in la isku dayo:

  • Gutenberg Blocks
  • CoBlocks
  • Quusin kara
  • Atomic Blocks.
  • Gutenberg horumarsan

Mawduuca Customizer iyo Block Editor waxay qabtaan shaqo aad u fiican marka ay timaado muuqaalka iyo habaynta qaabaynta, laakiin mawduuca caruurtu wuxuu ku siin karaa kontorool weyn muuqaalka iyo dareenka bogaggaaga.

Sida Loo Abuuro Mawduuca Ilmaha ee Mawduuca Labaatanka iyo labaatanka

Dhisidda mawduucyada carruurta ee WordPress waxay noqon kartaa madadaalo iyo sidoo kale hab wanaagsan oo lagu bilaabo xirfad sida horumariyaha mawduuca WordPress iyo labaatan Twenty waxay noqon kartaa mawduuc waalid oo weyn marka la dhisayo mawduucyada carruurta ee WordPress. Haddaba, maxaad u tijaabin wayday? 😉

Haddii aadan aqoon halka laga bilaabo mawduucyada carruurta, hubi inaad hubiso hagahayaga la fidiyay ee ku saabsan Sida Loo Abuuro Mawduuca Ilmaha ee WordPress.

Hadda, aynu u dhisno mawduuca ilmaheena kowaad labaatan iyo labaatan!

Hoos ka samee hage cusub wp-content/themes oo u magacow wax u eg twentytwenty-child ama wax kasta oo aad jeceshahay.

Uxoogso wp-content/themes/twentytwenty-child iyo abuur cusub style.css ku fayl garee ciwaanka soo socda:

/*
Theme Name: My Twenty Twenty Child Theme
Theme URI: https://example.com
Description: A child theme for Twenty Twenty.
Author: Your Name
Author URI: https://example.com/
Template: twentytwenty
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

Marka xigta, waa inaan ku darnaa qaabka xaashida mawduuca waalidka. Isla tusaha, samee kuwan soo socda functions.php faylka:

Now go to Appearance → Themes and activate your Child Theme. You can now start with your customizations.

Activate the child theme
Activate the child theme

You can change almost anything in Twenty Twenty, from adding custom templates to adding your custom styles or changing the theme’s default styles.

Here I will show you how to create a new custom template for single posts and pages.

Adding a Custom Post/Page Template in Twenty Twenty

So far, we have created a child theme for Twenty Twenty and attached the parent styles to the child theme’s stylesheet. In the example below, we’ll get rid of the header and the footer, making room for the page’s body in a post/page template file.

Step 1

Copy and paste the following files from the parent theme to the child theme’s directory:

  • templates/template-full-width.php
  • header.php
  • footer.php

Step 2

Rename template-full-width.php to template-canvas.php (or whatever you like). Open the file, delete the current content, and paste the following:

Template Name sets the name of the template file as you’ll see it in the Block Editor, while Template Post Type defines the post types supporting this template file. The get_template_part function loads the singular.php file from the parent theme (we don’t need a copy of this file in our child theme).

Go to the WordPress dashboard and create a new post. Now you should find an additional page template in the Post attributes section.

A new template is available in Post Attributes
A new template is available in Post Attributes

Step 3

And now comes the fun part. Open header.php in your favorite text editor and wrap the header element inside the following if statement:


	

	

This code checks whether the page template is not templates/template-canvas.php. If the page template is templates/template-canvas.php, then it won’t include the site header and the modal menu.

Similarly, we can remove the footer from a post page when the active page template is our canvas. Just add the same condition in footer.php as shown below:


	
...

You can download the code of this example here.
Now create a new post or page, select the Canvas template in Post/Page attributes and check the page on the front site.

We took a closer look at the new WordPress default theme Twenty Twenty. Check out all the main features you need to know about! 🆕②⓪②⓪Click to Tweet

Summary

Twenty Twenty is a minimalist WordPress theme, with a single column layout. The way we’ll use it mostly depend on the evolution of the Block Editor. As Anders expressively says:

“The promise of the Block Editor is to give users the freedom to design and structure their sites as they see fit”.

Following Twenty Nineteen, the new Twenty Twenty default theme is the second in a new generation of themes aiming to “allow the construction of websites without manual code editing”. WordPress sites powered by the Twenty Twenty theme come in all shapes and sizes. To find out if a theme is using Twenty Twenty, check out our handy WordPress theme detector tool.

If you think that Gutenberg is still not completely reliable for your projects yet, you could add the blocks you’ll need with plugins like the ones listed above. Or, simply, you can embrace a third-party page builder.

Up to you now: install the new default WordPress theme, play around with it, and let us know what your thoughts are here in the comments!

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button