Тарзи илова кардани шорткодҳои фармоишӣ дар Page Builder Sandwich

Муаллиф

дар

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-и шумо насб шуда бошанд, шумо метавонед ин корро анҷом диҳед.

Here are some other helpful plugins that you can use to create your own custom shortcodes: