From the word itself, the word shortcode means exactly that: A short code; a shortcut code.
Kısa kodlar, geliştiricilerin normalde yapacağı gibi büyük kod blokları eklemenize gerek kalmadan web sitenize çeşitli öğeler (örneğin bileşenler gibi) eklemenize olanak tanır.
Örneğin, standart bir kod parçası uzunluk açısından muhtemelen şuna benzer görünürdü:
<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>
Bu örnek için, yukarıdaki kod parçasının koca bir paragraf dolusu Lorem Ipsum yer tutucu metni eklemenizi sağladığını varsayalım.
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.
Şimdi her iki kod parçasının da –orijinal, uzun parça ile yalnızca “lorem” kelimesini içeren kısa kod– tamamen aynı şeyi yaptığını hayal edin: Lorem Ipsum metni eklemek.
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?
Favori bir eklentiniz veya bileşeniniz varsa, büyük olasılıkla kullanabileceğiniz bir kısa kodu da mevcuttur.
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
Page Builder Sandwich’te, kısa kodları doğrudan içerik alanınıza yazarak veya kopyalayıp yapıştırarak sayfanıza ekleyebilirsiniz.
Bunu aşağıda, Shortcodes Ultimate eklentisinden bir kısa kod kullanarak Page Builder Sandwich demo sayfasına bir içerik kutusu ekleyerek gerçekleştirdik:
Another thing you’ll find handy when using Page Builder Sandwich is our Shortcode Mapping feature.
Kısa Kod Eşleme (Shortcode Mapping) hakkındaki önceki makalelerimizden birine göre tanım şu şekildedir:
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.
Bunun bir anlamı da artık kısa kodlarınızı ilgili belgelerinde veya depolarında manuel olarak aramak zorunda kalmayacak olmanızdır.
Kısa kodu içeren eklenti WordPress sitenizde yüklü olduğu sürece, Page Builder Sandwich üzerinde kullanmanız için kolayca erişilebilir olacaktır.
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.
Dolayısıyla, özel kısa kodlar veya kendi oluşturduğunuz kısa kodları eklemek istiyorsanız, WordPress sitenize yüklü oldukları sürece bunu yapabilirsiniz.
