WordPress.org

Forums

Twenty Thirteen
[resolved] author name on posts (11 posts)

  1. frusi
    Member
    Posted 1 year ago #

    hi all,

    I am having difficulties with a simple tasks. I'd like to display the author name for blog posts. I tried to paste this snippet of code <?php the_author() ?> in various places but with no results. Anyone can help me?

    thanks a lot!

  2. WPMU DEV
    Member
    Posted 1 year ago #

    Hi @frusi,

    This function must be used within The Loop.

    Where are you using it?

    Kind Regards,

  3. frusi
    Member
    Posted 1 year ago #

    Thank you so much. I copied the line in the post.php file. I dont have any php knowledge . Shall I put that line on the index.php?

    thanks for helping.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Are you using a child theme?

  5. frusi
    Member
    Posted 1 year ago #

    no. I looked at the author.php file and it seems that the author should be displayed. I am lost :(

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    Do not edit the theme itself. First create a child theme for your changes.

  7. Brandon
    Member
    Posted 1 year ago #

    Once you create a child theme, add the below line to your style sheet within the child theme:

    .single-author .entry-meta .author {
    	display: inline;
    }
  8. frusi
    Member
    Posted 1 year ago #

    i figured it out a way to display it but I have no idea how to have it align with the rest of the content. anyone?

    http://www.wbruford.com/blog/

    thanks a lot to you all for the suggestion!

  9. WPMU DEV
    Member
    Posted 1 year ago #

    Hi @frusi,

    Awesome, great to see you got that resolved.

    To align it with the rest of the content, just move the code you have added in between any of the following markups.

    <header class="entry-header">
    ....
    </header>
    
    <div class="entry-content">
    ...
    </div>
    
    <footer class="entry-meta">
    ...
    </footer>

    Alternatively you can wrap it in the markup as following and aaply following stylesheet on it.

    <div class="author-link">
    ...// Your code goes here
    </div>
    .author-link{
    margin: 0 auto;
    max-width: 1040px;
    padding: 0 376px 0 60px;
    width: 100%;
    }

    Cheers,

  10. frusi
    Member
    Posted 1 year ago #

    @WPMU DEV than you so much for this! I got it solved! :)

  11. WPMU DEV
    Member
    Posted 1 year ago #

    You are most welcome, if I can be of any further assistance please don't hesitate to ask :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags