From the word itself, the word shortcode means exactly that: A short code; a shortcut code.
Met shortcodes kun je dingen toevoegen aan je website (zoals bijvoorbeeld widgets), zonder dat je enorme stukken code hoeft toe te voegen zoals ontwikkelaars dat gewoonlijk zouden doen.
Een regulier stuk code zou er qua lengte bijvoorbeeld waarschijnlijk ongeveer zo uitzien:
<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>
Laten we voor dit voorbeeld doen alsof het bovenstaande stukje code je een hele alinea Lorem Ipsum-plaatshoudertekst laat toevoegen.
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.
Stel je nu voor dat beide stukken code – het originele, lange stuk versus de shortcode die alleen het woord “lorem” bevat – allebei precies hetzelfde doen: Lorem Ipsum-tekst toevoegen.
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?
Als je een favoriete plug-in of widget hebt, is de kans groot dat deze een shortcode heeft die je kunt gebruiken.
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
In Page Builder Sandwich kun je shortcodes rechtstreeks aan je pagina toevoegen door ze simpelweg in je inhoudsgebied te typen of te kopiëren en plakken.
We hebben dit hieronder gedaan met een shortcode van Shortcodes Ultimate, waarmee een inhoudsvak is toegevoegd op de Page Builder Sandwich-demopagina:
Another thing you’ll find handy when using Page Builder Sandwich is our Shortcode Mapping feature.
Uit een van onze eerdere artikelen over Shortcode Mapping is de definitie als volgt:
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.
Dit betekent deels dat je niet langer handmatig naar je shortcodes hoeft te zoeken in hun respectievelijke documentatie of repositories.
Zolang je de plug-in met de shortcode op je WordPress-site hebt geïnstalleerd, is deze eenvoudig te gebruiken in 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.
Dus als je aangepaste shortcodes wilt toevoegen, of shortcodes die je zelf hebt gemaakt, dan kan dat, zolang je ze op je WordPress-site hebt geïnstalleerd.



Er zijn tientallen en tientallen page builders op de markt, en je vraagt je vast af: 


Dit artikel geeft een kort overzicht van hoe Page Builder Sandwich werkt, en is bedoeld als introductie voor diegenen die geïnteresseerd zijn in hoe onze page builder integreert met verschillende onderdelen van WordPress. Ik zal niet ingaan op de afzonderlijke functies van Page Builder Sandwich; als u die wilt zien, ga dan naar onze videopagina waar we elke functie afzonderlijk laten zien met korte screencasts.


