WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] query_posts from individual authors

[Resolved] query_posts from individual authors

  • I use the cover-wp theme by onedesigns.com and on the home page is a featured div that takes 3 post from a category and displays them.
    See here Home

    I’m making an Authors php and would like to adapt the below code to only get post from the current authors of the author php
    See here Authors Page

    <?php query_posts("caller_get_posts=1&showposts=3&category_name=".get_option('cover_wp_featured_cat', 'Featured')); $i = 1; ?>

    I’ve searched tried every thing I could find with no luck.
    Thanks For Any Help at all!

Viewing 3 replies - 1 through 3 (of 3 total)
  • http://codex.wordpress.org/Author_Templates#Sample_Template_File

    You don’t need to use a query to call the author’s posts on an author template if you define the $curauth variable on the template

    Check out that entire page I linked…. once you define the variable, you can just run a standard loop

    I think the OP is trying to show posts in one specific category on the author page. Since the author is already specified in the default query string on an author page, something like this should work:

    global $query_string;
    query_posts( $query_string . '&ignore_sticky_posts=1&posts_per_page=3&category_name=' . get_option( 'cover_wp_featured_cat', 'Featured' ) );

    I switched out caller_get_posts and showposts with ignore_sticky_posts and posts_per_page since the former two have been deprecated.

    Here are all the parameters you can use with query_posts():

    http://codex.wordpress.org/Class_Reference/WP_Query#Parameters

    Thank You Big Bagel agian you to Rev. Voodoo
    Second time you made my day Big Bagel! I refer to
    this
    Thanks a Million!

    By the By heres my new Author page!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] query_posts from individual authors’ is closed to new replies.