• Hi there,

    I had some help from ‘Skippy’ a while ago but alas I am still having problems showing my authors on author.php page.

    When I click on an author via ‘wp_list_authors’ link there are no details passed to the author.php page.

    Skippy seemed to think that it was due to my usernames being full names. Like this:

    Charlotte Cairns

    Because ‘author name’ on the query string is charlotte-cairns and in the db the author name is ‘Charlotte Cairns’

    This is my HT Access: https://phpfi.com/62065

    This is my author.php: https://phpfi.com/62064 with lines 13 – 22 ammended as per instructions. The problem is it still don’t work.

    This is an example author URL:
    https://www.elyonline.co.uk/archives/author/charlotte-cairns/

    Is there a fix when you want to use full names?

    Thanks
    Karl

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have to tell you, this code right here:

    $authname = strpos(get_query_var('author_name'), 0, 1);
    $offset = strpos(get_query_var('author_name'), '_');
    $authname .= strpos(get_query_var('author_name'), $offset++, 1);

    Is a total mystery to me. strpos() returns the integer index within the first parameter of the second parameter. Assigning an integer to $authname is just… wrong. Perhaps you meant to use substr()?

    Thread Starter karlb

    (@karlb)

    Hi,

    That was some code Skippy gave me and me not being the brightest star in the PHP world I have no clues ??

    Any further suggestions?

    Thanks

    I could see something like the following:

    $offset = strpos(get_query_var('author_name'), '_');
    $authname = substr( get_query_var('author_name'), 0, $offset );
    $authname .= " ".substr( strrchr(get_query_var('author_name'), '_'), 1 );

    Thread Starter karlb

    (@karlb)

    Darn that don’t work either ??

    I think I am destined not to have an author page that lists their bio and name.

    Thanks

    Echo out the $authname and let’s see what is in there. Something like this:

    echo "Author name: '$authname'";

    Thread Starter karlb

    (@karlb)

    Hmmm nothing at all there.

    I take it I just put ‘<?php echo “Author name: ‘$authname'”; ?>’ in

    Thanks for your time.

    Thread Starter karlb

    (@karlb)

    Hi there,

    I don’t normally bump but I am totally at a loss as to why my author.php won’t work.

    Is hthere anyone who could possibly advise?

    author.php…https://phpfi.com/62113
    .htaccess… https://phpfi.com/62065

    If you are too busy I fully understand. I have spent hours trying to find out to no avail.

    Thanks
    Karl

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘author page and ht access problems’ is closed to new replies.