ne $dir zeigt mir den www/htdocs/ pfad an. der muss komplett weg.
Warum? Verstehe ich nun nicht. Das $dir, also den Serverpfad, brauchst Du doch, um das Verzeichnis einlesen zu können.
Für die Anzeige brauchst Du dann $path und in dem wird wohl das "www/htdocs/" nicht stehen, oder?
Schreib hier doch mal im Klartext hin, was die beiden Funktionen get_stylesheet_directory() und get_stylesheet_directory_uri() genau als Ergebnis liefern. Und ich meine genau, nichts weglassen oder so.
https://codex.wordpress.org/Function_Re ... ectory_uri
Note that this returns a properly-formed URI; in other words, it will be a web-address (complete with http:// or https:// etc). As such, it is most appropriately used for links, referencing additional stylesheets, or probably most commonly, images (in this examples, inside an inline <style> declaration within a template .php file): .wp-menu-image { background: url(<?php echo get_stylesheet_directory_uri() ?>/images/gavel.png) }
Das brauchst Du also zur Anzeige der Bilder, nur eben nicht wie um Beispiel /images/, sondern Deinen Ordner.
https://codex.wordpress.org/Function_Re ... _directory
Note that this returns an absolute server path (eg: /var/www/html/myblog/wp-content/themes/my_theme), not a URI. As such, it's most suitable for file-level operations, such as: require_once(get_stylesheet_directory() . '/my_include.php');
So, das ist also der Serverpfad, den brauchst Du um das Verzeichnis überhaupt einlesen zu können.
Hm, aber genau das hatte ich ja schon zuvor geschrieben. Und wenn ich mich recht erinnere Chris auch.