Forums

How to Add Author to Twenty Eleven Theme (4 posts)

  1. 5SGR
    Member
    Posted 8 months ago #

    Hello, I am trying to add the author at the top of the post after "Posted on (the date)." I've looked up several similar queries in the forums, but none of them are helpful for the Twenty Eleven theme. I know I have to change the code in the index.php, and the solution I found was to change
    <small><?php the_time('F jS, Y') ?> </small>
    to
    <small><?php the_time('F jS, Y') ?> by <?php the_author() ?></small>
    However, that original code doesn't exist in the index.php file for the Twenty Eleven theme.
    Here is the full code for my index.php

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Where do I add the author? I don't even see the code for the post time. Any help will be greatly appreciated.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues.

    Create a child theme for your customisations. Once your child theme is active, we should be able to help with the customisation.

  3. alchymyth
    The Sweeper
    Posted 8 months ago #

    the author is already in twenty eleven, just not shown if the blog posts are written by one autor only;

    it is hidden by this style in style.css:

    .single-author .entry-meta .by-author {
    	display: none;
    }
  4. Rev. Voodoo
    Volunteer Moderator
    Posted 8 months ago #

    The easiest way on twentyeleven, is to have another user write a post

    even sign up a dummy user and make one post

    When more than one author exists on twentyeleven, it displays author information

    If you don't want to go that route, you can make a child theme, and we can go from there, as @esmi suggested

    EDIT: Would a quick plugin removing that class hurt anything else?

    http://pastebin.com/UyRrBQe3
    I'm pretty sure this would make a plugin which would remove the class, thus showing the author with no theme rev needed

Reply

You must log in to post.

About this Topic

Tags