From the word itself, the word shortcode means exactly that: A short code; a shortcut code.
Shortcodes ermöglichen es Ihnen, Dinge zu Ihrer Website hinzuzufügen (wie beispielsweise Widgets), ohne riesige Codeblöcke einfügen zu müssen, wie Entwickler es normalerweise tun würden.
Ein normaler Codeabschnitt würde beispielsweise von der Länge her wahrscheinlich etwa so aussehen:
<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>
Nehmen wir für dieses Beispiel an, dass der obige Code es Ihnen ermöglicht, einen ganzen Absatz mit Lorem-Ipsum-Platzhaltertext hinzuzufügen.
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.
Stellen Sie sich nun vor, dass beide Code-Teile – das ursprüngliche, lange Stück im Vergleich zum Shortcode, der nur das Wort „lorem“ enthält – genau dasselbe tun würden: Lorem-Ipsum-Text hinzufügen.
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?
Wenn Sie ein Lieblings-Plugin oder -Widget haben, stehen die Chancen gut, dass ein Shortcode zur Verfügung steht, den Sie verwenden können.
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 können Sie Shortcodes direkt zu Ihrer Seite hinzufügen, indem Sie sie einfach eingeben oder per Copy-and-Paste in Ihren Inhaltsbereich einfügen.
Wir haben dies unten mit einem Shortcode von Shortcodes Ultimate getan und eine Inhaltsbox auf der Demoseite von Page Builder Sandwich hinzugefügt:
Another thing you’ll find handy when using Page Builder Sandwich is our Shortcode Mapping feature.
Aus einem unserer früheren Artikel über Shortcode-Mapping lautet die Definition wie folgt:
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.
Dies bedeutet unter anderem, dass Sie nicht mehr manuell in den jeweiligen Dokumentationen oder Repositorien nach Ihren Shortcodes suchen müssen.
Solange Sie das Plugin, das den Shortcode enthält, auf Ihrer WordPress-Website installiert haben, steht es Ihnen in Page Builder Sandwich problemlos zur Verfügung.
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.
Wenn Sie also eigene Shortcodes oder selbst erstellte Shortcodes hinzufügen möchten, können Sie das tun, solange Sie diese auf Ihrer WordPress-Website installiert haben.
