Joomla - 404 Error-Seite mit YOOtheme erstellen
Joomla 3.x | 4.x
Weg mit den langweiligen Standard Fehler-Seiten und her mit kreativen Alternativen! Mit YOOtheme und Joomla! ganz einfach eine Custom 404-Seite erstellen – so geht’s:
Quelle: https://publishingblog.ch/custom-404-yootheme-joomla/
- Custom 404-Seite gestalten
Erstelle einen neuen Beitrag und gestalte darin mit dem YOOtheme Page Builder deine eigene 404-Seite nach Lust und Laune. Merke dir die Beitrags-ID.
https://publishingblog.ch/wp-content/uploads/2021/02/404_yootheme_id-300x42.png 300w, https://publishingblog.ch/wp-content/uploads/2021/02/404_yootheme_id-768x108.png 768w, https://publishingblog.ch/wp-content/uploads/2021/02/404_yootheme_id-200x28.png 200w" alt="Custom 404: Beitrags-ID" width="1021" height="144" class="attachment-full size-full" style="max-width: 100%; height: auto;" loading="lazy" />
- Child-Theme erstellen
Im FTP-Programm deiner Wahl erstellst du im Ordner «templates» einen Ordner für dein Child-Theme. Der Ordner-Name muss mit «yootheme_» beginnen.
Beispiel-Name: «yootheme_error»https://publishingblog.ch/wp-content/uploads/2021/02/404_yootheme_ordner-300x260.png 300w, https://publishingblog.ch/wp-content/uploads/2021/02/404_yootheme_ordner-200x173.png 200w" alt="Custom 404: FTP" width="471" height="408" class="attachment-full size-full" style="max-width: 100%; height: auto;" loading="lazy" />
- error.php erstellen
In diesem Ordner erstellst du nun eine neue Datei, die du «error.php» nennst. Diese befüllst du mit untenstehendem Code. Ersetze «XX» mit der Beitrags-ID aus Schritt 1.
Tipp: Am einfachsten erstellst und bearbeitest du diese Datei direkt im FTP-Programm oder in einem Text-Editor.<?php defined('_JEXEC') or die; if (($this->error->getCode()) == '404') { header('Location: /index.php?option=com_content&view=article&id=
XX'); exit; }
- Child-Theme aktivieren
Im YOOtheme unter «Einstellungen»/«Erweitert» im Dropdown-Menü «Child-Theme» das soeben erstellte Child-Theme auswählen. Speichern nicht vergessen.
https://publishingblog.ch/wp-content/uploads/2021/02/404_yootheme_child-theme-300x262.png 300w, https://publishingblog.ch/wp-content/uploads/2021/02/404_yootheme_child-theme-200x175.png 200w" alt="Custom 404: Child-Theme aktivieren" width="386" height="337" class="attachment-full size-full" style="max-width: 100%; height: auto;" loading="lazy" />
Fertig!