Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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

    #449620

    Hi 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,
    Elliott

    #449692

    Hi 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

    #450184

    Hi!

    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.
    #450934

    Elliot,

    The code is working wondefully. Thanks for your quick support!

    Regards,

    Chapdes

    #451015

    Hi!

    Great, glad we could help :)

    Regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘AUTHOR NAME & CATEGORY IN BLOG POSTS’ is closed to new replies.