Wenn man auf meinem Blog auf "Kommentar" klickt, ändert sich zwar die URL in ....../#comments, es sind aber keine Kommentare zu sehen. Mist. Ich habe vorher im Code herumgefuhrwerkt und ein paar mal aus "comments" ins Deutsche übersetzt. Kann es sein, dass das einmal zu viel war? Wenn ja, wo?
Kommentare nicht zu sehen
-
-
- Gerade eben
- Anzeige
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
- ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
- ✔️ Deutsche Server & DSGVO-konform
- ✔️ Persönlicher Support (kein 0815-Ticket-System)
-
-
Vielen Dank für die Antwort. Ich glaube die h3 ist in Ordnung. Deshalb habe ich mir erlaubt, die comments.php wie folgt zu zitieren:
PHP
Alles anzeigen<?php // Do not delete these lines if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die (__('Please do not load this page directly. Thanks!','yashfa')); if ( post_password_required() ) { ?> <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.','yashfa') ; ?></p> <?php return; } ?> <!-- You can start editing here. --> <?php if ( have_comments() ) : ?> <?php if ( ! empty($comments_by_type[__('Kommentar','yashfa')]) ) : ?> <h3 id="comments"> <?php fb_comment_type_count(__('Kommentar','yashfa')); ?> Comments <a href="#respond"><?php _e('Add Yours ↓','yashfa');?></a></h3> <p class="cinfo"><?php _e('The upper is the most recent comment','yashfa');?></p> <ol class="commentlist"> <?php $cmntCnt = 1;?> <?php wp_list_comments('type=comment&callback=list_comment'); ?> </ol> <div class="navigation"> <div class="alignleft"> <?php previous_comments_link() ?> </div> <div class="alignright"> <?php next_comments_link() ?> </div> </div> <br class="clear" /> <?php endif; ?> <?php if ( ! empty($comments_by_type[__('pings','yashfa')]) ) : ?> <h3 id="pings"><?php fb_comment_type_count(__('pingback','yashfa')); _e('Trackbacks/Pingbacks' );?> </h3> <ol class="trackbacklist"> <?php wp_list_comments('type=pings&callback=list_pings'); ?> </ol> <?php endif; ?> <br class="clear" /> <?php else : // this is displayed if there are no comments so far ?> <?php if ('open' == $post->comment_status) : ?> <!-- If comments are open, but there are no comments. --> <?php else : // comments are closed ?> <!-- If comments are closed. --> <p class="nocomments"><?php _e('Comments are closed.','yashfa');?></p> <?php endif; ?> <?php endif; ?> <?php if ('open' == $post->comment_status) : ?> <div id="respond" class="comform"> <h3> <?php comment_form_title(__('Ihr Kommentar','yashfa'), __('Your Comment to %s','yashfa') ); ?> </h3> <div class="cancel-comment-reply"> <small> <?php cancel_comment_reply_link(); ?> </small> </div> <?php if ( get_option('comment_registration') && !$user_ID ) : ?> <p><?php _e('You must be','yashfa');?> <a href="<?php echo get_option(__('siteurl','yashfa')); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e('logged in','yashfa');?></a><?php _e('to post a comment.','yashfa');?></p> <?php else : ?> <form action="<?php echo get_option(__('siteurl','yashfa')); ?>/wp-comments-post.php" method="post" id="commentform"> <div class="oneform"> <?php if ( $user_ID ) : ?> <p><?php _e('Logged in as','yashfa');?> <a href="<?php echo get_option(__('siteurl','yashfa')); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account','yashfa');?>"><?php _e('Log out »','yashfa');?></a></p> <?php else : ?> <p> <label for="author"><small><?php _e('Name','yashfa');?></label> <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /> </p> <p> <label for="email"><small><?php _e ('Mail','yashfa')?></small></label> <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /> </p> <p> <label for="url"><small><?php _e('Website','yashfa')?></small></label> <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> </p> <?php endif; ?> </div> <div class="secondform"> <p> <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea> </p> </div> <p> <input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Kommentar senden','yashfa')?>" /> <?php comment_id_fields(); ?> </p> <?php do_action(__('comment_form','yashfa'), $post->ID); ?> </form> <?php endif; // If registration required and not logged in ?> </div> <?php endif; // if you delete this the sky will fall on your head ?>Da kann man ganz gut sehen, wo ich Veränderungen vorgenommen habe. Außerdem habe ich die single.php und die index.php in gleicher Weise mit Übersetzungen gequält.
-
Sieht so aus, als hättest du hier einen Fehler gemacht:
bitte wieder zurück ändern:Ich vermute aber dass du noch mehr solche Fehler eingebaut hast. Die Zeile sieht nämlich auch komisch aus:
Und bei den Pings genau das gleiche :-?
Dann noch die hier:
und die:Irgendwie hast du dich sehr ungeschickt angestellt. Stellen die nicht zu übersetzen sind versuchst du zu übersetzen ... und andere Stellen lässt du widerum in Englisch. Mal davon abgesehen, dass auch die Methode der Übersetzung falsch ist. :confused:
-
Es geht wieder! Ein ganz großes Dankeschön. Ich habe allerdings nur den ersten Fehler rückgängig gemacht. Das yashfa-Gedöns war vorher schon da. Ich habe es deshalb lieber drin gelassen.
Die zweite von Dir erwähnte Zeile hat bislang keine merkbaren Änderungen gebracht. Ich habe sie dennoch wieder auf "comment" zurückgesetzt.
An den weiteren beiden bemängelten Codes bin ich unschuldig. Da habe ich nix gemacht, ehrlich.
Gibt es denn eine andere (richtige) Methode zur Übersetzung?:oops:
-
Gibt es denn eine andere (richtige) Methode zur Übersetzung?:oops:
ja, die Sprachdatei zu ändern. Auf die Weise kannst du die anderen Templates in Ruhe lassen und es passieren nicht diese Fehler.
Das Theme sieht so aus als wenn es eine Sprachdatei .po/.mo mitbringt. Die .po lässt sich mit POEdit oder Codestyling Localization editieren und dann wieder als .mo exportieren.Mein Vorschlag: Spiel das Original-Theme wieder ein und ändere nur die Sprachdatei.
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!