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 дефиницията е следната:
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 сайт.



Има десетки и десетки конструктори на страници и сигурно се питате: 

Ако сте заклет блогър, за когото цялото създаване на съдържание се върти около писането на пълнометражни статии с някоя случайна илюстрация, тогава може би съществуващият TinyMCE редактор на съдържание е достатъчен за вашите нужди. Текущият набор от инструменти вече съдържа всичко необходимо за писане на статии – имате основни инструменти за форматиране на текст като получер, курсив, заглавия и т.н. Но това е горе-долу всичко.