Forums

Howto include another author in author.php of a theme? (6 posts)

  1. niska
    Member
    Posted 3 years ago #

    How can I change the author template to include another author (I have the user ID). I also need the RSS feed to include this author.

    I think I need to do something like this: query_posts('author='.$user->ID.',4')

    I've never modified a theme before. But I'm familiar with php. But I'm not sure where to put the code. Is there a hook to modify? I'm using the P2 theme (if that matters).

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    Not sure about that theme but should point you to Template Hierarchy and Author Templates.

  3. niska
    Member
    Posted 3 years ago #

    Am I correct thinking that this might work?

    Before The Loop in authors.php:

    set_query_var('author', get_query_var('author').',4');

    Or do I need to use query_post() directly?

  4. MichaelH
    Volunteer
    Posted 3 years ago #

    $moreposts=get_posts('author=4);
    if ($moreposts) (
    //loop for author 4 posts
    }

  5. niska
    Member
    Posted 3 years ago #

    Thank you for your help!

    Is it possible to mix the results? The current author + author 4. At the same time?

  6. MichaelH
    Volunteer
    Posted 3 years ago #

    Not sure I know how to do that (mixing the results).

Topic Closed

This topic has been closed to new replies.

About this Topic