Forums

author info (name and email) in sidebar and header? (2 posts)

  1. Andrew1234
    Member
    Posted 2 years ago #

    I've been modifying the plaintxtBlog theme to simplify the look even more and remove some functionality for some realy basic blogs (internal to my company). I didn't know much about PHP and wordpress but its been fun to learn a lot. And I still don't know much. :-(

    Anyway, one aspect is that each blog will only have one author. I'm trying to include the author name and other details (such as email) in both the header and sidebar.

    Nothing I do seems to work. I've tried most of the solutions talked about on the forum. Such as http://wordpress.org/support/topic/51469
    I've also tried other ideas such as
    http://lorelle.wordpress.com/2006/05/06/using-author-template-tags-outside-of-the-wordpress-loop

    I know the problem has something to do with the_author() calls not working 'outside the loop'.

    I'm using Wordpress 2.0.1. Perhaps those solutions don't work in 2.0?

    Any ideas would be appreciated. Thanks in advance.

  2. Andrew1234
    Member
    Posted 2 years ago #

    Found the solution at the bottom of http://wordpress.org/support/topic/51469

    Sample code I used in sidebar.php:

    <a href="mailto:<?php $curauth = get_userdata(intval(1)); echo $curauth->user_email; echo '?subject='; bloginfo('name'); echo ' enquiry'; ?>" title="Email the author <?php $curauth = get_userdata(intval(1)); echo $curauth->display_name; ?>">Email the author</a>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags