SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,582
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    display author name

    I have this code in my author.php file
    PHP Code:
    <h1 class="entry-title author">All posts by <?php get_the_author(); ?></h1>
    But it doesn't appear to work,
    http://fixmysite.us/gmpc/?author=1

    Shouldn't this work?
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Iligan City, Philippines
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that function is already deprecated, try checking the WordPress Codex to verify.
    Here's a quick fix:

    <h1 class="entry-title author">All posts by <?php echo get_the_author(); ?></h1>

    but we're using the deprecated function here, so, here's an alternative solution:

    <h1 class="entry-title author">All posts by <?php the_author(); ?></h1>

  3. #3
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,582
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    k, thanks, so the function get_the_author() is outdated but to get the authors name all I need is the_author()
    "Oh, and Jenkins--apparently your mother died this morning."

  4. #4
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Iligan City, Philippines
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yup! try it out man


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •