WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] author.php query question (4 posts)

  1. slivehappy
    Member
    Posted 4 years ago #

    I am creating an author.php template

    I would like to run a query based on the author_name but I don't want to hard code the author_name

    how to I modify this so it grabs the variable from the query string?
    query_posts('author_name=Harriet');

    Thanks

  2. slivehappy
    Member
    Posted 4 years ago #

    and of course sanitizes it .. I am sure that is built into wordpress

  3. slivehappy
    Member
    Posted 4 years ago #

    would like to run a query based on the author_name but I don't want to hard code the author_name

    query_posts('author_name=Harriet');

    how to I modify the query so it grabs the variable from the url?

    http://mysite.com/wp/author/bob = query_posts('author_name=bob');

    http://mysite.com/wp/author/sam = query_posts('author_name=sam');

  4. slivehappy
    Member
    Posted 4 years ago #

    this works
    <?php query_posts('author=' . $curauth->ID . '&showposts=10'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic