Ich möchte, dass wenn man auf den Namen von einer Person klickt, die einen Kommentar hinterlassen hat, die Homepage dieser Person in einem Neuen Tab (target = "blank") geöffnet wird. Wo kann ich das ändern? Habe bis jetzt die richtige Stelle in der richtigen Datei noch nicht gefunden.
Homepage einer Personen in neuem Tab öffnen
-
-
- 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)
-
Poste mal die comments.php bitte.
-
comments.php
PHP
Alles anzeigen<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?> <p><?php _e('Enter your password to view comments.'); ?></p> <?php return; endif; ?> <h2 id="comments"><?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments')); ?> <?php if ( comments_open() ) : ?> <a href="#postcomment" title="<?php _e("Leave a comment"); ?>">»</a> <?php endif; ?> </h2> <?php if ( $comments ) : ?> <ol id="commentlist"> <?php foreach ($comments as $comment) : ?> <li id="comment-<?php comment_ID() ?>"><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?> <?php comment_text() ?> </li> <?php endforeach; ?> </ol> <?php else : // If there are no comments yet ?> <p><?php _e('No comments yet.'); ?></p> <?php endif; ?> <p><?php comments_rss_link(__('Kommentare zu diesem Artikel als RSS-Feed.')); ?> <br> <?php if ( pings_open() ) : ?> <a href="<?php trackback_url() ?>" rel="trackback"><?php _e('TrackBack'); ?></a> <?php endif; ?> </p> <?php if ( comments_open() ) : ?> <h2 id="postcomment"><?php _e('Leave a comment'); ?></h2> <?php if ( get_option('comment_registration') && !$user_ID ) : ?> <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p> <?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <?php if ( $user_ID ) { ?> <div id="authorinfo" style="">Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout »</a> <?php } else if($comment_author) { echo ('<span style="" id="showinfo">(<a href="javascript: ShowUtils();">change your information</a>)</span>'); echo'<span id="hideinfo" style="display: none">(<a href="javascript: HideUtils();">Close</a>)</span>'; echo '<div id="authorinfo" style="display: none">'; ?> <?php } else { ?> <div id="authorinfo" style=""> <?php } ?> <?php if ( !$user_ID ) { ?> <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" onfocus="this.style.background='#ffffff'" onblur="this.style.background='#ffffff'" /> <label for="author"><small>Name <?php if ($req) _e('(required)'); ?></small></label></p> <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" onfocus="this.style.background='#ffffff'" onblur="this.style.background='#ffffff'" /> <label for="email"><small>Mail (will not be published) <?php if ($req) _e('(required)'); ?></small></label></p> <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" onfocus="this.style.background='#ffffff'" onblur="this.style.background='#ffffff'" /> <label for="url"><small>Website</small></label></p> <?php } ?> <!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>--> </div> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4" onfocus="this.style.background='#ffffff'" onblur="this.style.background='#ffffff'" ></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="" class="submit_button" /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> </p> <?php do_action('comment_form', $post->ID); ?> </form> <?php endif; // If registration required and not logged in ?> <?php else : // Comments are closed ?> <p><?php _e('Sorry, the comment form is closed at this time.'); ?></p> <?php endif; ?> -
Lösung markiert (scroll mal etwas nach rechts falls nötig):
PHP
Alles anzeigen<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?> <p><?php _e('Enter your password to view comments.'); ?></p> <?php return; endif; ?> <h2 id="comments"><?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments')); ?> <?php if ( comments_open() ) : ?> <a href="#postcomment" title="<?php _e("Leave a comment"); ?>">»</a> <?php endif; ?> </h2> <?php if ( $comments ) : ?> <ol id="commentlist"> <?php foreach ($comments as $comment) : ?> <li id="comment-<?php comment_ID() ?>"><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> [COLOR="Red"][del]<?php comment_author_link() ?>[/del][/COLOR] [COLOR="Blue"]<a href="<?php comment_author_url () ?>" target="_blank"><?php comment_author() ?></a>[/COLOR] — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?> <?php comment_text() ?>[SIZE="1"]Nur als Randbemerkung: Das "target"-Attribut wird in künftigen HTML-Standards nicht mehr enthalten sein (in der Strict-Variante ists bereits raus). Und viele BEsucher nervts wenn ungefragt neue Fenster/Tabs auf gehen. ;-)[/SIZE]
-
Thx
Danke, hat geholfen.
Zitat[size=8]Nur als Randbemerkung: Das "target"-Attribut wird in künftigen HTML-Standards nicht mehr enthalten sein (in der Strict-Variante ists bereits raus).[/SIZE]
[size=8] Hmmm... ich hoffe das da etwas neues kommt mit welchem man Seiten in einem neuen Tab öffnen kann?
[/SIZE]
Zitat
[size=8] Und viele BEsucher nervts wenn ungefragt neue Fenster/Tabs auf gehen. :wink:[/SIZE]Hehe, micht nervts dass ich die Ursprungsseite nicht mehr finde wenn ich mehrere Links angeklickt habe und alle im gleichen Tab geöffnet werden :-D. Jedem das Seine, wer aber darüber nachdenken ;-).
-
ich hoffe das da etwas neues kommt mit welchem man Seiten in einem neuen Tab öffnen kann?
"target" war Bestandteil der Frames-Technologie, damit konnte man einzelne Frames adressieren. Von daher auch sinnvoll. Das man mit "_blank" neue Browserfenster öffnen konnte war eher Abfallprodukt. ;-) Neue Browser interpretieren "_blank" meistens als neues Tab. Ist ja auch mehr oder weniger okay so.ZitatHehe, micht nervts dass ich die Ursprungsseite nicht mehr finde wenn ich mehrere Links angeklickt habe und alle im gleichen Tab geöffnet werden :-D. Jedem das Seine, wer aber darüber nachdenken ;-).
Klar, jedem das Seine, du sagst es. Also schreib deinen Besuchern das nicht vor. :-P Übrigens, schon gewusst? Mit Klick auf die mittlere Maustaste kann man in den meisten Browsern Links in neuem Fenster bzw. Tab öffnen. Egal was der Webseitenautor definiert hat. (Andersrum gehts leider nicht so schön...) -
Da haste auch wieder recht.
-
Hi, meine Frage:
Wie kann ich
<div class="c-author"><?php comment_author_link() ?></div>
in neuer Seite öffnen?
oder bracuht man die ganze comment.php -
Übrigens, schon gewusst? Mit Klick auf die mittlere Maustaste kann man in den meisten Browsern Links in neuem Fenster bzw. Tab öffnen. Egal was der Webseitenautor definiert hat. (Andersrum gehts leider nicht so schön...)
Mach das mal bei einem Mac 8)
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!