Tagged: author name, category, postslider
-
AuthorPosts
-
May 24, 2015 at 4:12 am #449171
Hi,
My blog grids are showing post comment quantity and publish date, even though I´ve chose to show only the author name and category in the Enfold blog settings.
How can I make my blog grids show only the author name and blog category?
Regards,
Chapdes
May 25, 2015 at 5:16 pm #449620Hi chapdes!
Open up /enfold/config-templatebuilder/avia-shortcodes/postslider.php and change lines 377 – 387 from this,
$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'>".get_the_author()."</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>";
To this,
$output .= "<div class='slide-meta'>"; $category = get_the_category(); $output .= get_the_author() . ' / ' . $category[0]->cat_name; $output .= "</div>";
Best regards,
ElliottMay 25, 2015 at 7:43 pm #449692Hi Elliot,
Your code is not working, and even makes my site crash when I try to Login.
We do not have the same code in lines 377-387; my postslider.php has these:
$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>";
Please help me solve this problem,
Regards,
Chapdes
May 26, 2015 at 5:01 pm #450184Hi!
That’s the same code as I posted in my previous post so I’m not sure what you mean. Like I said you need to change it to this.
$output .= "<div class='slide-meta'>"; $category = get_the_category(); $output .= get_the_author() . ' / ' . $category[0]->cat_name; $output .= "</div>";
Best regards,
Elliott- This reply was modified 9 years, 6 months ago by Elliott.
May 28, 2015 at 6:57 am #450934Elliot,
The code is working wondefully. Thanks for your quick support!
Regards,
Chapdes
May 28, 2015 at 9:25 am #451015 -
AuthorPosts
- The topic ‘AUTHOR NAME & CATEGORY IN BLOG POSTS’ is closed to new replies.