WordPress.org

Forums

Author tags not calling... (9 posts)

  1. trashcast
    Member
    Posted 9 years ago #

    I am trying to set it up so that when you click on the author link in the sidebar, it calls all the posts of that author. That works very well, but I have tried to place a header at the top that states the authors name followed by "archive". I have tried using this tag: <h2 class="pagetitle"><?php the_author_nickname(); ?>'s Archive</h2>
    but all that shows up is " 's Archive". I don't understand why it's not working, as my time and date archives are set up the same way and work just peachy. Can anyone help me with this? See for yourself...http://trashcast.com/author/travis/
    any help would be greatly appreciated as I have been trying to get this working for a few weeks now :)

    -trav

  2. Beel
    Member
    Posted 9 years ago #

    "This tag must be used within The Loop."

  3. trashcast
    Member
    Posted 9 years ago #

    As far as I know, it is within the loop. The codex states the same thing for time and date tags, they work just fine, and they all are in the same loop. Do I need to edit multiple loops? The one I have worked on is in archive.php. Should I place it in another location as well?
    Thanks Beel.

  4. Beel
    Member
    Posted 9 years ago #

    A header at the top is not within the loop.

  5. trashcast
    Member
    Posted 9 years ago #

    Well can anyone suggest another way of accoomplishing my goal? Why do the date and time tags return data if they are also not within the loop?

    Thanks!

  6. Beel
    Member
    Posted 9 years ago #

  7. Kafkaesqui

    Posted 9 years ago #

    "Why do the date and time tags return data if they are also not within the loop?"

    A theme using tags in this way benefits from a certain leakiness in The Loop, in that many (though not all) post array values from the last post on the page are still extant.

    Anyway, you could try 'querying' the last post object just above or before the sidebar code you list above:

    <?php
    $wp_query->post;
    ?>

    If that fails, try a global scope:

    <?php
    global $post, $wp_query;
    $wp_query->post;
    ?>

    The link Beel provides offers more advice/alternatives.

  8. trashcast
    Member
    Posted 9 years ago #

    Thanks everyone. I appreciate your help greatly.

Topic Closed

This topic has been closed to new replies.

About this Topic