Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #285624

    Hi guys,

    On my homepage I’m displaying blog posts in the grid format.
    Now standard there is no blog author displaying which I’d like to.

    I’ve tried several things such as ‘get_user_meta’, ‘get_the_author’ and nothing worked for me.

    How can I display the blog author per blog post on my homepage?

    Thanks in advance.

    Jerry

    #285977

    Hi Jerry,

    Can you post the link to the website please?

    Regards,
    Josue

    #286100
    This reply has been marked as private.
    #286422

    Hi Jerry,

    Open /config-templatebuilder/avia-shortcodes/postslider.php and look for line 386:

    $output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>";
    

    Replace it by this:

    $output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time> / by ".get_the_author();
    

    Regards,
    Josue

    #286537

    Hi Josue,

    Thanks for your reply.
    Unfortunately this did not completely worked. It’s showing names with the blog posts however it’s the same name for every post while the actual author is different.
    So: the author on the archive is different then the actual blog author (which is also showing on the innerpage).

    I’ve attached two screenshots:

    1. Archive – I’ve marked the same author in yellow below every post and the name of 1 post particular in orange
    2. Innerpage – I’ve marked the author in yellow (you can see it’s different then the archive and the name of the post (to show it’s the same) in orange again.

    Thanks,
    Jerry


    #286592

    Hi!

    Please go again to /config-templatebuilder/avia-shortcodes/postslider.php and look for line 386:

    and replace this line with the following 2 lines:

    
    $author = get_the_author_meta( 'user_nicename', $entry->post_author );
    $output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time> / by ".$author;
    
    

    If user_nicename is not what you want, you can also use:

    
    $author = get_the_author_meta( 'first_name', $entry->post_author ).' '.get_the_author_meta( 'last_name', $entry->post_author );
    

    Regards,
    Günter

    • This reply was modified 10 years, 4 months ago by Günter.
    #286599

    Hi Günter,

    Thanks a lot!
    This is working just fine.

    Thanks for the support guys.

    Thanks,
    Jerry

    #286621

    Hey!

    Glad we could help you.

    Thank you for visiting the forum and enjoy the theme.

    Best regards,
    Günter

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Show blog author on blog grid’ is closed to new replies.