Hi,
habe mal eine Frage,und zwar möchte ich für jeden Author eine kleine Seite erstellen,wo man Informationen über die jeweillige Person findet.
Wenn man bei einem Beitrag auf den Namen des Author klickt,der den Beitrag geschrieben hat,der mit <?php the_author() ?></p> angezeigt wird,sollte man auf diese Seite gelinkt werden,die dem Author gewidmet ist.
Ist sowas möglich?
Author Seite
-
-
- 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)
-
Zum einen kannst du das über ein neues Template "author.php" realisieren, zum anderen gibt`s auch ein Plugin:
http://guff.szub.net/2005/01/31/get-author-profile/ -
also ich hab mir das plugin runtergeladen und wenn ich es aktiviere bekomme ich folgende fehlermeldung:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-admin/admin.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-admin/admin.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-admin/admin.php on line 12
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-admin/admin.php on line 13
mehr hab ich ja noch garnicht gemacht,wieso erscheitn dann ein fehler?
-
..schau mal ob in der "get-author-profile.php" am Anfang oder Ende eine Leerzeile ist.
-
nein,wie unten zu erkennen :/
PHP
Alles anzeigen<?php /* Plugin Name: Get Author Profile Plugin URI: http://guff.szub.net/get-author-profile Description: Assigns specified author profile information to global variables for use in your weblog. Version: 0.2 Author: Kaf Oseo Author URI: http://szub.net ~Changelog: 0.2 (13-Dec-2004) Added two new variables from outside WordPress' user profile set (but still considered part of it): * $author_posts (number of posts for author) * $author_posts_link (link to all author's posts) There's also a new function: author_profile(). This merely echos the values of the variables--for anyone who prefers doing things the WordPress way. */ function get_author_profile($auth_id) { global $wpdb, $tableusers, $posts, $authordata; global $author_aim, $author_email, $author_firstname, $author_icq, $author_lastname, $author_level, $author_login, $author_msn, $author_nickname, $author_posts, $author_posts_link, $author_profile, $author_url, $author_yim; $author_posts = get_usernumposts($auth_id); $author_posts_link = get_author_link(0, $auth_id, $authordata->user_nicename); $query = $wpdb->get_results("SELECT * FROM $tableusers WHERE ID = '$auth_id' LIMIT 1"); foreach ($query as $profile) { $author_aim = $profile->user_aim; $author_email = $profile->user_email; $author_firstname = $profile->user_firstname; $author_icq = $profile->user_icq; $author_lastname = $profile->user_lastname; $author_level = $profile->user_level; $author_login = $profile->user_login; $author_msn = $profile->user_msn; $author_nickname = $profile->user_nickname; $author_profile = $profile->user_description; $author_url = $profile->user_url; $author_yim = $profile->user_yim; } } function author_profile($info = 'nickname') { global $author_aim, $author_email, $author_firstname, $author_icq, $author_lastname, $author_level, $author_login, $author_msn, $author_nickname, $author_posts, $author_posts_link, $author_profile, $author_url, $author_yim; switch ($info) { case 'aim': echo $author_aim; break; case 'email': echo $author_email; break; case 'firstname': echo $author_firstname; break; case 'icq': echo $author_icq; break; case 'lastname': echo $author_lastname; break; case 'level': echo $author_level; break; case 'login': echo $author_login; break; case 'msn': echo $author_msn; break; case 'nickname': echo $author_nickname; break; case 'posts': echo $author_posts; break; case 'posts_link': echo $author_posts_link; break; case 'profile': echo $author_profile; break; case 'url': echo $author_url; break; case 'yim': echo $author_yim; break; } } ?> -
Ich kann den Fehler unter 1.5.1.3 nicht reproduzieren...
-
kann mir einer erklären wie dieses plugin genau funktioniert?
ich kann auch nicht wirklich draus erkennen,welchen code ich auf der z.B. author.php wiedergeben muss damit die profile aller user angezeigt werden. -
Zitat von lemox
kann mir einer erklären wie dieses plugin genau funktioniert?
ich kann auch nicht wirklich draus erkennen,welchen code ich auf der z.B. author.php wiedergeben muss damit die profile aller user angezeigt werden.
das steht auf der website des plugins:
dann findet man dort weiter unten noch ein Beispiel:PHP
Alles anzeigenExample: <div class="profile"> <ul> <li id="myprofile">Blog Owner: <ul> [*]<?php author_profile('firstname'); ?> <?php author_profile('lastname'); ?> [*]ICQ: <?php author_profile('icq'); ?> [*]AIM: <?php author_profile('aim'); ?> [*]Notes: <?php author_profile('profile'); ?> [/list] [/list] </div>dazwischen steht auch noch was, ..bitte selber weiterlesen,-weil ich ja nicht weiß was Du nicht weißt oder brauchst
lgMonika
-
so,das plugin läuft nun und ist unter folgendem link zu finden:
http://www.gedankeninferno.de/wordpress/?page_id=51dennoch erscheint im wp-admin bereich oben immernoch besagter fehler:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-admin/admin.php on line 10dazugekommen ist noch:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 7Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-includes/pluggable-functions.php on line 163
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-includes/pluggable-functions.php on line 164
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-includes/pluggable-functions.php on line 165
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-includes/pluggable-functions.php on line 166
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 27
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 29
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-login.php on line 30
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web45/html/wordpress/wp-content/plugins/get-author-profile.php:97) in /var/www/web45/html/wordpress/wp-includes/pluggable-functions.php on line 129
wenn ich mich auf meiner seite ausloggen möchte.
abgesehen von den fehlern ein schönes plugin,wer mag mich retten? :)
-
-
völlig unabhängig vom plugin
hast Du die Autoren gefragt, ob Du deren email Adresse veröffentlichen darfst und deren Zugänge,
denn 1.musst Du das(rechtlich) und
2. nehm ich 10000000% an, werdet ihr mit spamemails zugeschüttet, wenn die emails Adressen einfach so auf einer website stehen..... :shock:lG
Monika -
Keiner hat bisher seine Einwände genannt,vielleicht freuen sie sich ja auch,wenn sie eventuell Liebesbriefe bekommen,falls sich jemand in den Schreibstil verliebt *grummel*
ich wollt eigentlich nur die fehler beseitigt haben.
-
1. die inhaltlich verantwortlichen sind im impressum zu nennen, auch mit email, eigentlich sogar mit telefon.
2. ist der eintrag nach dem ich gefragt habe vorhanden? daran könnte es nämlich liegen.
-
1. Das hier ist meine profile.php, dort steht dieser besagte wp-head tag nicht:
PHP
Alles anzeigen<?php /* Template Name: Profile */ ?> <?php get_header(); ?> <div id="main" class="main"> <table width="100%" cellspacing="0" cellpadding="0"> <tr> </tr> </table> <table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> </tr> <?php if (function_exists('wp_theme_switcher')) { ?> <?php } ?> </table> <table width="100%" cellspacing="0" cellpadding="0"> <tr> </tr> </table> <?php if (have_posts()) : ?> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <?php while (have_posts()) : the_post(); ?> <tr> </tr> <tr> <td></td> </tr> <tr> <td rowspan="2"></td> <td><span class="header-title"><span id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?> </a></span></span></td> <td rowspan="2"><span class="header-title"><span id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> </a></span></span></td> </tr> <tr> <td> Blogbesitzer und Admin: <?php get_author_profile(1); ?> Name: <?php author_profile('firstname'); ?> <?php author_profile('lastname'); ?> Nickname: <?php author_profile('nickname'); ?> ICQ: <?php author_profile('icq'); ?> AIM: <?php author_profile('aim'); ?> YIM: <?php author_profile('yim'); ?> MSN: <?php author_profile('msn'); ?> Email: <?php author_profile('email'); ?> Website: <?php author_profile('url'); ?> Geschriebene Beiträge: <?php author_profile('posts'); ?> Beiträge des Benutzers: <?php author_profile('posts_link'); ?> Anmerkungen: <?php author_profile('profile'); ?> [/list] Benutzer und Autoren: <?php get_author_profile(2); ?> Name: <?php author_profile('firstname'); ?> <?php author_profile('lastname'); ?> Nickname: <?php author_profile('nickname'); ?> ICQ: <?php author_profile('icq'); ?> AIM: <?php author_profile('aim'); ?> YIM: <?php author_profile('yim'); ?> MSN: <?php author_profile('msn'); ?> Email: <?php author_profile('email'); ?> Website: <?php author_profile('url'); ?> Geschriebene Beiträge: <?php author_profile('posts'); ?> Beiträge des Benutzers: <?php author_profile('posts_link'); ?> Anmerkungen: <?php author_profile('profile'); ?> [/list] <?php get_author_profile(4); ?> Name: <?php author_profile('firstname'); ?> <?php author_profile('lastname'); ?> Nickname: <?php author_profile('nickname'); ?> ICQ: <?php author_profile('icq'); ?> AIM: <?php author_profile('aim'); ?> YIM: <?php author_profile('yim'); ?> MSN: <?php author_profile('msn'); ?> Email: <?php author_profile('email'); ?> Website: <?php author_profile('url'); ?> Geschriebene Beiträge: <?php author_profile('posts'); ?> Beiträge des Benutzers: <?php author_profile('posts_link'); ?> Anmerkungen: <?php author_profile('profile'); ?> [/list] <?php get_author_profile(5); ?> Name: <?php author_profile('firstname'); ?> <?php author_profile('lastname'); ?> Nickname: <?php author_profile('nickname'); ?> ICQ: <?php author_profile('icq'); ?> AIM: <?php author_profile('aim'); ?> YIM: <?php author_profile('yim'); ?> MSN: <?php author_profile('msn'); ?> Email: <?php author_profile('email'); ?> Website: <?php author_profile('url'); ?> Geschriebene Beiträge: <?php author_profile('posts'); ?> Beiträge des Benutzers: <?php author_profile('posts_link'); ?> Anmerkungen: <?php author_profile('profile'); ?> [/list] </p></td> </tr> <tr> <td rowspan="2"></td> <td><?php the_content('Read the rest of this entry »'); ?></td> <td rowspan="2"></td> </tr> <tr> </tr> <tr> <td rowspan="3"></td> <td class="header"><div class="comments"> <div align="left"> <?php edit_post_link('Bearbeiten',''); ?> <?php comments_popup_link('Kommentar schreiben', '1 Kommentar', '% Kommentare'); ?> </div> </div> </td> <td rowspan="3"></td> </tr> <tr> <td><?php comments_template(); ?></td> </tr> <tr> </tr> <?php endwhile; ?> </table> <div class="navigation"> <div class="alignleft"> <table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr><td width="2%" rowspan="2" class="header-date"></td> <td width="98%" colspan="2" class="header-date">Copyright [url="http://wordpress.org/"][/url]© 2005 by [url="mailto:lemox@gmx.de"]lemox[/url] | Powered by [url="http://wordpress.org/"]Wordpress[/url] <div align="left"></div> <div align="left"></div></td> </tr> <tr> <td colspan="2" class="header-date"><?php posts_nav_link('','','« Previous Entries') ?> <span class="alignright"> <?php posts_nav_link('','Next Entries »','') ?> </span></td> </tr> <tr> <td colspan="3" class="header-date"></td> </tr> </table> </div> <div class="alignright"></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> </div> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> </p>2.Handelt es sich um eine private, nicht gewerbliche Seite, und dort muss weder ein Impressum vorhanden sein, weder noch Name,Email oder gar Telefonnummer.
-
Zitat
<?php get_footer(); ?>
</p>
lösche mal</p
amEndelG
Monika -
zu 2. stimmt, vergessen
zum code:
schau mal in deine header.php bzw poste deren inhalt. -
So,hab diesen Beitrag nochmal editiert.Habe zuerst das
</p entfernt,aber daran lags nichts.
Aber ihr glaubt nicht nach welcher Aktion es nun funktioniert und keine Fehler mehr ausgibt:
In der get-author-profile.php war an letzter Stelle bei
hinter dem > ein Leerzeichen,für das blosse Auge nicht zu erkennen,habe auch nur zufällig dort hingeklickt und mir nichts dabei gedacht einmal return zu drücken.
Jetzt funktioniert es :)
Trotzdem Dankeschön -
Ich führe den Beitrag mal fort, da es um dasselbe Thema geht. Allerdings will ich es nicht mit einem Plugin lösen, sondern mit dem Template author.php
Ausgehend von einem Beispiel aus hemingwayGray habe ich folgende author.php für das verwendete Theme erstellt:
PHP
Alles anzeigen<?php get_header(); ?> <div class="maincolumn"> <?php if(get_query_var('author_name')) : $curauth = get_userdatabylogin(get_query_var('author_name')); else : $curauth = get_userdata(get_query_var('author')); endif; ?> <div class="post"> <h1>Über: <?php echo $curauth->nickname; ?></h1> <dl> <dt>Name</dt> <dd><?php echo $curauth->first_name. ' ' . $curauth->last_name ;?></dd> <dt>Website</dt> <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd> <dt>Details</dt> <dd><?php echo $curauth->description; ?></dd> </dl> <?php if (have_posts()) : ?> <h1>Artikel von <?php echo $curauth->nickname; ?></h1> <ul class="dates"> <?php while (have_posts()) : the_post(); ?> <li><span class="date"><?php the_time('j. F Y') ?></span> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> abgelegt unter <?php the_category(', ') ?></li> <?php endwhile; ?> </ul> <div class="navigation"> <div class="left"><?php next_posts_link('« Vorige Artikel') ?></div> <div class="right"><?php previous_posts_link('Folgende Artikel »') ?></div> <?php else : ?> <h1>Nichts gefunden</h1> <?php endif; ?> <br /><br /> </div></div></div> <?php get_footer(); ?>Das Problem liegt darin, dass die oberen Angaben zum Autor nicht angezeigt werden. Klassische Varianten wie
kann ich nicht nutzen, da sich der obere Teil nicht im Loop befindet und es natürlich keinen Sinn macht, den Loop dahin zu erweitern ;-)
Hat jemand einen Tipp, wie sich das Problem lösen lässt?
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!