WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Trouble Adding Byline to Twenty Eleven (10 posts)

  1. midlife mama
    Member
    Posted 1 year ago #

    I have the Twenty Eleven theme and would like to add a byline directly below the title in my posts. (I added a new user to my blog and still the byline doesn't show. You can see the blog here if you need to.)

    I know that I need to build a Child Theme instead of changing the code and I'm working on learning on how to do that but it's a bit overwhelming as I'm not technically trained. (I'm a writer not a programmer.)

    In the meantime, can someone walk me through the steps in changing the code? I've found a few discussions about it here but a step-by-step would be greatly appreciated.

  2. Marventus
    Member
    Posted 1 year ago #

    Hi!
    Where would you like the byline to show up?

    Edit: Sorry, I just re-read your post and realized you already provided that information. What I don't understand is why the author name is not appearing next to the date, since the twentyeleven_posted_on() theme function should be printing both the date and the author's name.

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    if you only plan to make formatting changes, you could use a custom css plugin (for instance the custom css of 'jetpack'), instead of making a child theme, to add new css styles;

    for instance use this style to overwrite the hiding of the autor in single author sites using Twenty Eleven:

    .single-author .entry-meta .by-author {
    	display: inline;
    }
  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    I need to build a Child Theme instead of changing the code

    Yes, definitely do that before making any changes to the theme! Trying to do it later and/or losing all your changes really is not the way to go.

  5. Marventus
    Member
    Posted 1 year ago #

    Alchymyth's solution would work like a charm since it seems the author has been hidden using CSS code.
    Sorry I took so long to realize.
    Cheers!

  6. midlife mama
    Member
    Posted 1 year ago #

    Thanks for all the responses.
    @WPyogi: Yes, I agree but it's taking me a long time to master so I thought I'd do a short fix in the meantime. I realize I'll lose the changes once I update to the next Twenty Eleven, but if it's just a snippet of code to add, is it really a big deal? Am I missing something?

    @Marventus: when you say the author has been hidden using CSS code, can you elaborate (I'd like to learn)? I haven't changed the code so I'm not sure why it would be hidden.

    @alchymyth: I do have JetPack but I don't have the Custom CSS configured. Could you tell me where I would add the following?:
    .single-author .entry-meta .by-author {
    display: inline;
    }

    Thanks again to all. Truly appreciate the help. I'm learning so much day by day!

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    With a default theme, it's especially important to not change the theme itself -- because in various situations, it's crucial to have a clean copy of the theme for troubleshooting. You'll see in many threads, it's suggested that people switch to that theme as part of identifying a problem and/or recovering access to their site. So if your problem (often caused by something you changed or did) exists in that theme, it's harder to fix. That said, twentytwelve is soon to be the official default theme (maybe it already is), so it's less critical, but do be sure you have twentytwelve installed. Are you using WP3.5? It should be installed with it.

    The other thing is that it's not really a big deal to make a child theme -- and involves things (like FTP and editing files) that you really need to know how to do anyway. I know it seems daunting at first, but if you take it one step at a time, and ask for help as you need it, I'm sure you can do it :).

    Okay, all that said, changing CSS in one spot is not a big deal. Just want you to have full disclosure!

    And even better, since you have jetpack - it's not even a problem at all. Just put the code suggested in the jetpack custom CSS - this thread tells you where that should be:

    http://wordpress.org/support/topic/jetpack-plugin-custom-css-not-intuitive?replies=3

  8. Marventus
    Member
    Posted 1 year ago #

    Sure. What I was trying to say is that the name of the author was hidden using CSS code, and that Alchymyth's code should unhide it. In order to implement that code, you would need to create a child theme.
    If that article is too long to follow, simply do this:

    1. Create a folder inside your wp-content/themes folder called twentyeleven-child.

    2. Create a new txt document, and paste this code inside it:

    /*
    Theme Name: Twentyeleven Child
    Description: Child theme for the twentyeleven theme
    Author: Midlife Mama
    Template: twentyeleven
    */
    
    @import url("../twentyeleven/style.css");
    
    .single-author .entry-meta .by-author {
    display: inline!important;
    }

    3. Save that text document inside the child theme folder you created, and name it style.css. Make sure you save the file in utf-8 format (not ANSI).

    4. Upload the new child theme to your server via FTP into your server's themes folder.

    5. Activate your new child theme from your WP Admin Panel (Appearance --> Themes), and you should now see the by [author] text next to your post dates.

    Cheers!

  9. midlife mama
    Member
    Posted 1 year ago #

    @WPyogi: What you're saying makes total sense. I have read where people say, "try reverting back to the default theme." Now it makes much more sense to me. And yes, I'm using WP 3.5 and yes, Twenty Twelve is the new default theme.

    I've been reading about Child Themes and taking an online course through Lynda.com--it's just taking me awhile to digest it all!

    I will, however, look into the jetpack solution.

    @Marventus: Thank you! What you've written also makes sense! Perfect.

    I'll look into all solutions and get back with the results.

    Thanks again!

  10. midlife mama
    Member
    Posted 1 year ago #

    The Jetpack custom css worked! Now I'll start working on mastering a Child Theme to change other attributes in Twenty Eleven.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic