From the word itself, the word shortcode means exactly that: A short code; a shortcut code.
Shortcode-et ju lejojnë të shtoni gjëra në faqen tuaj të internetit (si widget-et, për shembull), pa pasur nevojë të shtoni pjesë të mëdha kodi siç bëjnë zakonisht zhvilluesit.
Për shembull, një pjesë e zakonshme kodi, për nga gjatësia, ka të ngjarë të dukej diçka e tillë:
<html>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id aliquam turpis. Vivamus quis arcu tincidunt, finibus urna eget, placerat risus. Aliquam arcu massa, finibus et lacinia sed, scelerisque nec augue. Quisque eu viverra sapien, vel consequat lorem. Integer vel erat tortor. Phasellus condimentum magna eget congue venenatis. Suspendisse blandit vehicula consectetur. Nullam sodales eleifend massa, in bibendum purus fermentum id. Morbi et turpis feugiat, malesuada ipsum sit amet, interdum nulla. In non ante nec nisl mattis gravida sit amet id lectus. </html>
Për këtë shembull, le të pretendojmë se pjesa e kodit më sipër do t’ju lejojë të shtoni një paragraf të tërë me tekst vendmbajtës Lorem Ipsum.
Now, a shortcode with the same exact function as the code above will look something like this, in contrast:
[lorem ipsum dolor estat]Lorem Ipsum[/lorem]
You can see how they’re miles different from each other in terms of length.
Tani imagjinoni sikur të dyja pjesët e kodit – Pjesa origjinale dhe e gjatë, përballë shortcode-it që përmban vetëm fjalën “lorem”, të bënin saktësisht të njëjtën gjë: Të shtonin tekstin Lorem Ipsum.
This is what shortcodes do. They make adding widgets, functions, and a bunch of other cool stuff easier for both ordinary WordPress users and developers alike.
Where can I find shortcodes?
Nëse keni një shtojcë ose widget të preferuar, gjasat janë që ato të kenë një shortcode të disponueshëm për t’u përdorur.
Shortcodes Ultimate, for example, will let you choose from hundreds of shortcodes that you can use on Page Builder Sandwich (or anywhere, actually) by simply grabbing the shortcode of your choice from Shortcode Ultimate’s repository or documentation page.
Adding Custom Shortcodes on PBS
Në Page Builder Sandwich, mund të shtoni shortcode-e drejtpërdrejt në faqen tuaj thjesht duke i shkruar ose duke i kopjuar dhe ngjitur në zonën tuaj të përmbajtjes.
Ne e bëmë këtë më poshtë me një shortcode nga Shortcodes Ultimate, duke shtuar një kuti përmbajtjeje në faqen demo të Page Builder Sandwich:
Another thing you’ll find handy when using Page Builder Sandwich is our Shortcode Mapping feature.
Nga një prej artikujve tanë të mëparshëm mbi Shortcode Mapping, përkufizimi është si më poshtë:
Shortcode mapping is like letting Page Builder Sandwich memorize all the shortcodes available on your site: their names, descriptions, their attributes, and what each of these attributes do.
Kjo do të thotë gjithashtu se nuk keni më nevojë të kërkoni manualisht për shortcode-et tuaja në dokumentacionet ose depot e tyre përkatëse.
Për sa kohë që keni të instaluar në faqen tuaj të wordpress-it shtojcën që përfshin shortcode-in, ai do të jetë lehtësisht i disponueshëm për t’u përdorur në Page Builder Sandwich.
So for example, if I wanted to add a WooCommerce shortcode on my page, all I have to do is make sure that it’s installed on my WordPress site, like so:
And then, to actually add the shortcode, I’ll just go to my page, and drag and drop the Shortcode Element:
Because we already have WooCommerce installed on our WordPress site, you can see that all of the shortcodes that are available on the WooCommerce plugin are already available on Page Builder Sandwich. This is what Shortcode Mapping is.
You can also see on the upper left corner that the ACF (Advanced Custom Fields) and MailChimp shortcodes are available– because we have those instlled on our WordPress site, too.
Pra, nëse dëshironi të shtoni shortcode të personalizuara, ose shortcode që i keni krijuar vetë, mund ta bëni këtë, për sa kohë që i keni instaluar në faqen tuaj të WordPress-it.
