Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1431 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1431 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1431 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Undefined variable $blocks in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441 Warning: Trying to access array offset on value of type null in /customers/c/9/8/wpin4.1prod.one/httpd.www/landing-v2/wp-content/themes/onecom-landing-page-v2/functions.php on line 1441

Was ist ein Shortcode?

Wir zeigen Ihnen, wie und wo Sie Shortcodes unter WordPress einfügen

Shortcodes sind verkürzte Programmiercodes. Um zu definieren, wie ein Shortcode verwendet werden soll, schreiben Sie den Shortcode in eckige Klammern [wie diese].

Shortcodes ermöglichen auf Ihrer Website die Ausführung bestimmter Funktionen. Zum Beispiel benötigen einige Plugins einen Shortcode, um korrekt zu funktionieren, andernfalls können Besucher die Funktionen des installierten Plugins nicht sehen. Ein weiteres Beispiel für die Verwendung eines Shortcodes ist die Formatierung des Inhalts und der Struktur Ihrer Website. Wenn Sie etwa Kontaktformulare oder eine Preistabelle hinzufügen möchten, kann Ihnen ein Shortcode schnell dabei helfen. 

WordPress Shortcode Beispiel

Vielleicht fragen Sie sich, wie ein Shortcode in WordPress funktioniert und welche Funktionen dieser hat.

Nehmen wir an, Sie möchten drei verschiedene Tabs auf Ihrer Website erstellen. Einen „Über mich“ Reiter, einen zur Kontaktaufnahme und den letzten Tab für ein Produkt, welches Sie anbieten. Damit die Tabs einwandfrei funktionieren muss dazu ein Shortcode in WordPress geschrieben und hinzugefügt werden.

Etwa so:

[tabs]  – so werden alle Tabs geöffnet.. 

[tab title = “Über mich”] – hier schreiben wir den Name des ersten Tabs und erstellen diesen zugleich.

Tab content 1. – der gesamte Inhalt des ersten Tabs wird hier abgelegt.

[/tab] – so wird der erste Tab geschlossen.

[tab title= “Kontakt”]Erstellung und Benennung des zweiten Tabs.

Tab content 2. – Hier werden die Inhalte des zweiten Tabs untergebracht.

[/tab] – so wird der zweite Tab geschlossen.

[tab title= “Meine Blumen”] – Name des dritten Tabs.

Tab content 3. – Hier werden die Inhalte des dritten Tabs untergebracht.

[/tab] – hier wird der dritte Tab geschlossen.

[/tabs] – alle Tabs werden geschlossen.

Sobald Sie ein Plugin installieren und aktivieren, müssen Sie sich nicht mehr mit HTML und PHP auseinandersetzen. Der Entwickler des Plugins hat all dies bereits erledigt. Sie müssen lediglich Shortcodes wie den oben genannten verwenden, um eine Umgebung zu schaffen, in der das Plugin korrekt funktioniert. Das ist der Sinn von Shortcodes: Sie schaffen die Rahmenbedingungen für die Plugins.

Sie können beispielsweise auch ein Video in Ihre WordPress-Website einbetten. 

Der Shortcode dafür:

[youtube=http://www.youtube.com/watch?v=76IPdrSExzs]

Dieses Video würde dann angezeigt werden:

In WordPress einen Shortcode einfügen – wie geht das?

Jetzt wissen wir, was ein Shortcode in WordPress macht und wie Beispiele für Shortcodes aussehen können. Beschäftigen wir uns nun mit der Installation von Shortcodes in WordPress und wie man es in Beiträgen hinzufügt.

Dazu können Sie ein beliebiges Plugin auf Ihrem WordPress-Dashboard verwenden; einige Plugins generieren den Shortcode für Sie, den Sie einfach kopieren und dann auf einer Ihrer Seiten einfügen können. Diese Vorgehensweise ist am einfachsten, da Sie keinen Code schreiben, sondern den Shortcode anschließend nur im Editor in der „Code-Ansicht“ einfügen müssen.

Wenn Sie das Plugin zum Beispiel in Ihrer Seitenleiste anzeigen möchten und es keinen Shortcode für diesen Zweck generiert, funktioniert es trotzdem.

Gehen Sie in Ihrem Dashboard zum Editor und vergewissern Sie sich, dass Sie eine Kopie Ihrer Dateien erstellt haben, um Ihre Daten nicht zu verlieren und sozusagen ein „Backup“ für den Fall der Fälle zu besitzen. Dies gelingt durch die Verwendung eines Child-Themes. 

Scrollen Sie danach runter zu Ihrer PHP-Datei und verwenden folgenden Shortcode, der einen Filter hinzufügt:

add_filter(‘widget_text’, ‘do_shortcode’) 

Aktualisieren Sie anschließend die Datei und Sie werden sehen, dass das Plugin/Widget funktioniert und in Ihrer Seitenleiste angezeigt wird.

Wann immer Sie ein Plugin anzeigen möchten, z. B. eine Fotogalerie, ermöglicht der obige Codeschnipsel Ihrem Theme, das Plugin genau an der gewünschten Stelle zu platzieren.