From the word itself, the word shortcode means exactly that: A short code; a shortcut code.
Кратки кодови вам омогућавају да додајете ствари на свој веб-сајт (као што су виџети, на пример), без потребе да убацујете огромне делове кода као што би програмери иначе радили.
На пример, регуларан део кода, по питању дужине, вероватно би изгледао отприлике овако:
<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>
За овај пример, замислимо да вам горњи део кода омогућава да додате цео пасус 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.
Сада замислите да оба дела кода – оригинални, дугачки део, насупрот кратком коду који садржи само реч „lorem“, раде потпуно исту ствар: додају 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?
Ако имате омиљени додатак или виџет, велике су шансе да имају кратки код доступан за коришћење.
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-у можете додавати кратке кодове директно на своју страницу тако што ћете их једноставно укуцати или копирати и налепити у област за садржај.
То смо урадили испод помоћу кратког кода из додатка Shortcodes Ultimate, додајући оквир за садржај на демо страници Page Builder Sandwich-а:
Another thing you’ll find handy when using Page Builder Sandwich is our Shortcode Mapping feature.
Из једног од наших претходних чланака о мапирању кратких кодова, дефиниција је следећа:
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.
Део овога значи да више не морате ручно да тражите своје кратке кодове у њиховој одговарајућој документацији или спремиштима.
Све док имате додатак који садржи кратки код инсталиран на свом WordPress веб-сајту, биће вам лако доступан за коришћење у 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.
Дакле, ако желите да додате прилагођене кратке кодове, или кратке кодове које сте сами направили, можете то учинити, све док су инсталирани на вашем WordPress веб-сајту.
