WordPress.org

Ready to get started?Download WordPress

Forums

author link doesn't show profile (14 posts)

  1. warmbeer
    Member
    Posted 7 years ago #

    Hi there,

    i'am afraid that something has changed not only within the author_template.php that causes problems with mode_rewrite.

    So, im using permalinks on a apache 2.0 and php 5. The pattern is /%category%/%postname%-%post_id%/. Not really knowing why, this has been the only way, to get them running.

    the_author_link() should display a link to the authors profile page captured by an authors.php template.

    The author link, that is displayed within the loop, shows nothing then the garbage prefix http:// )-;

    I always thought, that this tag is pointing to something like http://www.myblog.org/author/mynickname instead of the entered website-url within the admin-profile dialog.

    Is there any way to get wp 2.2 fixing this issue?

    Thanx!

  2. whooami
    Member
    Posted 7 years ago #

    I always thought, that this tag is pointing to something like http://www.myblog.org/author/mynickname instead of the entered website-url within the admin-profile dialog.

    per the codex:

    This tag displays a link to the Website for the author of a post. The Website field is set in the user's profile (Administration > Profile > Your Profile). The text for the link is the author's Profile Display name publicly as field. This tag must be used within The Loop.

    the_author_link() should display a link to the authors profile page captured by an authors.php template.

    Not according to what I just read.

  3. warmbeer
    Member
    Posted 7 years ago #

    whooami,

    you're right. this is what i am talking about. the_author_link() doesn't show anything than http://.

    So it appears as if the php-core somehow misleads the params form author_url and author_link.

  4. whooami
    Member
    Posted 7 years ago #

    is there actually something in that field to be read? and are you sure?

  5. Sivar
    Member
    Posted 7 years ago #

    I had the same problem. Just use the_author_posts_link.

  6. warmbeer
    Member
    Posted 7 years ago #

    whooami.

    the field website within the admin/profile shows up the default (?) text: http://

    Sivar,

    this one is working fine.

    How do we get the params from the $authordata Array in there? May this could help out for a while...

  7. Sivar
    Member
    Posted 7 years ago #

    How do we get the params from the $authordata Array in there?
    In where? Are you asking for this?

  8. whooami
    Member
    Posted 7 years ago #

    I am really confused.. if the field inside the profile for the url is empty, how do you expect something thats checking that field to display something thats not there.

    the tag sivar is suggesting provides a link to the authors posts.. NOT that url.

    A url which you say is empty.

  9. warmbeer
    Member
    Posted 7 years ago #

    Sivar,

    this is, what i meant and already checking out. i am lucky, that the the_author_posts_link is triggering the author.php.

    But whooami, there is no need to be confused about my bad english or the circumstance, that the original meaning of the_author_link() disappeared somehow?

    Don't worry, i assume, that the team knows about that issue and will fix this.

  10. Sivar
    Member
    Posted 7 years ago #

    whooami... take a look at this. It says, one should use the_author_link() to get a link to author pages.

    What warmbeer and I experienced was, that the_author_link() echoes a link to the author's URL (which is stated in his profile), and not one to his author page.

  11. warmbeer
    Member
    Posted 7 years ago #

    Sivar,

    ;-) you've got it. it appears like all of the author tags are triggering the author.php, but not the the_author_link(). )-;

  12. warmbeer
    Member
    Posted 7 years ago #

    One (?) step ahead...

    In author-template.php i found at line 84 the following:

    function the_author_link() {
    	if (get_the_author_url()) {
    		echo '<a href="' . get_the_author_url() ...

    That means to me something like somebody undesigned inserted get_the_author_url() in here. No wonder that the_author_link echoes the authors home-url. This substitution disables the native sense of this function and just doubles get_the_author_url()!

    After wondering a while about this i found in line 138:

    /* the_author_posts_link() requires no get_, use get_author_posts_url() */
    function the_author_posts_link($deprecated = '') {
    	global $authordata; ....

    Unfortunately i have not enough time to check this out in older versions of WP. But setting a variable $deprecated, that never is used within this function - as well as in many others - is looking to me at least a little bit strange.

    Next: I really couldn't figure out, why the returned ancortext of the_author_posts_link did not match with the url of my author-page. The echoed link was always /author/admin/ instead of /author/myNickname/.

    What means, that the database-values of my nickname / nicename were unchangeble by changing settings in the adminpanel. Updating the permalink-structure in admin-panel made no changes too. I succeeded with this after changing my user_nicename in the wp_users table manually with phpMyAdmin.

    Now using the_author_posts_link() anything runs perfect - with other users too.

    Thanks to Mr. and Mrs. Strange, this has been a nice evening.

    Cheers from Bavaria

  13. warmbeer
    Member
    Posted 7 years ago #

    addendum:

    finally i decided to copy the code from line 141 the_author_posts_link() to line 85 and comment the mentioned missbehaviour:

    function the_author_link() {
    	global $authordata;
    	echo '<a href="' . get_author_posts_url($authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), attribute_escape(get_the_author())) . '">' . get_the_author() . '</a>';

    But this problem is not solved yet, or am i wrong?

  14. buzzdroid
    Member
    Posted 6 years ago #

    Our plugin Author Web solves the garbage "http://" problem correctly.

Topic Closed

This topic has been closed to new replies.

About this Topic