• I’d like to link to the author of a post’s archive page using the following code. I know I’m close, but I’m stumped.

    if($_opts['show_meta'] == 'true')
    			{
    				$userid = $child->post_author;
    				$userdata = get_userdata($userid);
    				$output .= "<div class='blog-info blog-date'>";
                    $output .= "<i class='fa fa-clock-o'></i>";
    				$output .= mysql2date('F j, Y',$child->post_date);
                    $output .= "</div>";
                    $output .="<a href='.$authorURL$user->ID.'>";
                    $output .="<div class='blog-info blog-author'>";
                    $output .= "<i class='fa fa-user'></i>";
                    $output .= $userdata->display_name;
    				$output .= "</div>";
                    $output .= "</a>";
                    $output .= "<div style='clear:both;'></div>";
    			}
Viewing 3 replies - 1 through 3 (of 3 total)
  • Which theme are you using?

    Thread Starter aimeedanger

    (@aimeedanger)

    It’s called lawyerbase. There is a lot of customization and a different file structure than I’m used to.

    The part that I’m having a problem with is this:

    $output .="<a href='.$authorURL$user->ID.'>";

    How would I write this to link to the author’s archive page? I’m kind of a noob at PHP.

    How are the two variables $authorURL$user->ID defined?
    Variables must be defined earlier. If not defined you are trying to output something that doesn’t exist

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘link to author's page in $output’ is closed to new replies.