Support » Themes and Templates » the_author is empty when not logged in

  • Is there a reason why the_author should return an empty string on the first page when the user is not logged in, but return the author name just as it should when more posts are loaded through AJAX ?
    The loop is the same in both cases.
    Please help me resolve this issue as I’m clueless and I need it fixed ASAP to launch my site.

    Here’s the whole index.php:

    <!-- MAIN DIV -->
    			<div id='content_and_floater'>
    				<?php get_template_part('social_floater'); ?>
    				<div id='content'>
    					<?php get_template_part('loop'); ?>
    			<?php get_template_part('loader'); ?>
    <!-- MAIN DIV -->

    And here’s how the infinitePaginator calls the loop in functions.php (the function is called when scrolled down to the bottom or the loader link is clicked):

    function wp_infinitepaginate(){
        $loopFile        = $_POST['loop_file'];
        $paged           = $_POST['page_no'];
        $posts_per_page  = get_option('posts_per_page');  
        # Load the posts
        query_posts(array('paged' => $paged ));
        get_template_part( $loopFile );  

    You can see the behaviour at
    In single posts it’s not working either. My guess is that query_posts(array(‘paged’ => $paged )); changed something in the query, but I don’t know what is it.
    I tried to insert setup_postdata($post); just after the_post() in loop.php as I found that worked for someone, but it doesn’t for me.

Viewing 1 replies (of 1 total)
  • I also tried to insert

    query_posts(array('paged' => 1 ));

    before calling the loop file in index.php, but no posts at all were shown.

Viewing 1 replies (of 1 total)
  • The topic ‘the_author is empty when not logged in’ is closed to new replies.