Tagged: author name
-
AuthorPosts
-
February 11, 2015 at 8:02 am #394143
Hello there, first of all I must say it’s a great theme and I am enjoying making site with it.
For my site its really important to show the author name. So, I want to show only the Author Name in Blog archive page in blog grid mode, not the date and comments count. How Can I do it? Thanks in advance.February 11, 2015 at 11:30 am #394216Any suggestion guys? I have searched the support forum but haven’t found any solution regarding display only the author name below the post title in blog archive in blog-grid mode.
February 11, 2015 at 12:49 pm #394279Hey!
Thank you for using our theme.
You have to modify the core file enfold\config-templatebuilder\avia-shortcodes\postslider.php.
Goto line 375 you find:
if($show_meta && !empty($excerpt)) { $output .= "<div class='slide-meta'>"; 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>"; } $markup = avia_markup_helper(array('context' => 'entry_time','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup)); $output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>"; $output .= "</div>"; }
Replace with:
if($show_meta && !empty($excerpt)) { $output .= "<div class='slide-meta'>"; $author_id = $entry->post_author; $author_name = get_the_author_meta('display_name', $author_id); $author_link = get_the_author_meta('user_url', $author_id); $output .= "<div class='slide-meta-comments'><a href='{$author_link}'>{$author_name}</a></div>"; // $output .= "<div class='slide-meta-del'>/</div>"; // 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>"; // } // $markup = avia_markup_helper(array('context' => 'entry_time','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup)); // $output .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>"; $output .= "</div>"; }
Cheers!
GünterFebruary 11, 2015 at 5:19 pm #394483Thanks a lot Günter, that works perfectly. Does this mean if I want to show the time in some of the blog post on different category blog archive it’s not possible anymore? There is a plugin “Custom Single Post Templates Manager” with that its possible to give some code on each of the category archive from archive.php. If it’s possible to do from archive.php then I can create a new_archive.php and assign it for a specific category.
- This reply was modified 9 years, 10 months ago by Anderson C.
February 11, 2015 at 5:36 pm #394503 -
AuthorPosts
- You must be logged in to reply to this topic.