WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Post Author not displayed (11 posts)

  1. clifburns
    Member
    Posted 6 years ago #

    The author name recently stopped showing up in posts unless I am logged in. Once I log out, the author name disappears. Needless to say that means that other readers aren't seeing the author name either.

    Here's the code in the index file (within the Loop)

    Posted by <a href="http://www.mungedxxx.com"> <?php the_author() ?></a> on <?php the_time('m/j/y') ?> at <?php the_time('g:i a') ?>.

    This displays: "Posted by on 7/29/06 at 8:03 pm"

    Any idea what's happening here?

  2. pramodd
    Member
    Posted 6 years ago #

    You are missing the semi-colon in PHP function calls.

  3. MichaelH
    Member
    Posted 6 years ago #

    Is it just a ; thingy?

    Try

    Posted by <a href="http://www.mungedxxx.com"> <?php the_author(); ?></a> on <?php the_time('m/j/y'); ?> at <?php the_time('g:i a'); ?>.

    oops pramodd faster ;)

  4. clifburns
    Member
    Posted 6 years ago #

    Thanks MichaelH and pramodd. I tried adding the semicolons, but that didn't fix it. Any other ideas?

  5. MichaelH
    Member
    Posted 6 years ago #

    Link to see problem?

  6. clifburns
    Member
    Posted 6 years ago #

    Link here
    Thanks!

    [link moderated by request]

  7. moshu
    Member
    Posted 6 years ago #

    What happens if you leave out the anchor part (a href...)? Does it work?
    If yes, and you want to make the author's name to point to his website, you could try using this:
    http://codex.wordpress.org/Template_Tags/the_author_url

  8. clifburns
    Member
    Posted 6 years ago #

    It doesn't work even with the anchor tag removed.

    The funny thing is that the author name shows up when I'm logged in, but doesn't when I'm not. That's what is so perplexing about this.

  9. MichaelH
    Member
    Posted 6 years ago #

    Well your code, with the correct ; of course, works just fine for me on a 2.2 WordPress Default 1.6 Theme. Logged in or logged out it works.

    Maybe post your index.php at http://wordpress.pastebin.ca/
    and report the link back here.

  10. clifburns
    Member
    Posted 6 years ago #

    I found the error. There was some php code for a poll that I wasn't using that was causing the problem. It was fixed when I commented it out. Now I just need to find the problem in that code if I start using it again. Thanks, however, for the prompt suggestions!

  11. clifburns
    Member
    Posted 6 years ago #

    Now that the problem is resolved, could a moderator please remove or obscure the link I supplied above to the post in question? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags