Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #373968
    #373969

    sorry wrong screen shot above

    here is correct one: http://i.imgur.com/dSnX80W.png

    #374112

    Hey!

    Open up /enfold/config-templatebuilder/avia-shortcodes/postslider.php and on lines 378 – 384 you should see this.

    if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio')
    {
    	$link_add = $commentCount === "0" ? "#respond" : "#comments";
    	$text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' );
    
    	$output .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add}</a></div><div class='slide-meta-del'>/</div>";
    }
    

    Change it to this.

    $output .= '<span class="blog-author minor-meta">'.__('by','avia_framework')." ";
    $output .= '<span class="entry-author-link" '.avia_markup_helper(array('context' => 'author_name','echo'=>false)).'>';
    $output .= '<span class="vcard author"><span class="fn">';
    $output .= get_the_author_link();
    $output .= '</span></span>';
    $output .= '</span>';
    $output .= "<div class='slide-meta-del'>/</div>";
    

    Cheers!
    Elliott

    #478874

    Hi there – I would like to do this same thing – although I don’t need to remove comment count as I have disabled the comments on my posts, but I would love to show the author of each post on grid-view. What are the changes I would need to make? The lines mentioned above are different in my postslider.php
    Thanks!

    #479152

    Hi!

    On the latest version of the theme it’s lines 392 – 398.

    Best regards,
    Elliott

    #481865

    Thanks…it kinda worked, only – it is only showing one author for all posts, when all three of my posts have different authors assigned.
    Any ideas? (Have included link to website, if you click into each post you will see each is by a different author, but only one of them is being displayed in grid view).
    Thanks!

    #482710

    Hi!

    Try this out instead.

    $output .= '<span class="entry-author-link" '.avia_markup_helper(array('context' => 'author_name','echo'=>false)).'>';
    $output .= '<span class="vcard author"><span class="fn">';
    $author_id = get_post_field( 'post_author', $the_id );
    $output .= '<a href = "'.get_author_posts_url( $author_id ).'">'.get_the_author_meta( 'user_nicename', $author_id ).'</a>';
    $output .= '</span></span>';
    $output .= '</span>';
    $output .= "<div class='slide-meta-del'>/</div>";
    

    Cheers!
    Elliott

    #483039

    Great thanks! Again, this ALMOST works…it only shows the authors first name though, and in lowercase. Would prefer full name and with each first letter being Caps (ie John Smith). See previous link to page to see what I mean!
    Thankyou!

    #483495

    Hey there, I am trying to do the same and I confirm it only works partially.
    As Carendavis says, the output is not correct: for example I get “admin” instead of the admin’s “Name Surname” as it should be.
    Elliott it would be great if you could help us to solve this, thank you!

    #483932

    Hi!

    On this part.

    $output .= '<a href = "'.get_author_posts_url( $author_id ).'">'.get_the_author_meta( 'user_nicename', $author_id ).'</a>';
    

    Try changing “user_nicename” to “display_name”.

    You can see how the function works here, https://codex.wordpress.org/Function_Reference/get_the_author_meta.

    Best regards,
    Elliott

    #484070

    It works, thank you ;)

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Remove and edit meta data under post in blog posts view’ is closed to new replies.