WordPress.org

Ready to get started?Download WordPress

Forums

While Loop using post_author to blog owner instead? (1 post)

  1. progresst
    Member
    Posted 4 years ago #

    I made a custom while loop with have_posts to use the Image Photo plugin (http://wordpress.org/extend/plugins/user-photo/) anywhere I want it.

    I assumed that the have_posts indicates that if the blog has at least one post? Please see the example below provided.

    My problem is when I am on a page that does not return the author it does not work. Is there an alternative to post_author like blog_owner I can use that would work even where there is no actual post? I hope that makes sense :-)

    ----Example----

    <?php while (have_posts()) : the_post(); ?>
    <?php userphoto($posts[0]->post_author); ?>
    <?php endwhile; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic