Last active
April 19, 2020 08:16
-
-
Save lots0logs/e2add9834332ee48b608 to your computer and use it in GitHub Desktop.
WordPress :: Divi Theme :: Include Tags In Post Meta When Displayed On Frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* DON'T copy the first line (above) if your functions.php already has it. | |
* ----------------------------------------------------------------------- */ | |
function et_pb_postinfo_meta( $postinfo, $date_format, $comment_zero, $comment_one, $comment_more ){ | |
$postinfo_meta = ''; | |
if ( in_array( 'author', $postinfo ) ) | |
$postinfo_meta .= ' ' . esc_html__( 'by', 'et_builder' ) . ' <span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>'; | |
if ( in_array( 'date', $postinfo ) ) { | |
if ( in_array( 'author', $postinfo ) ) $postinfo_meta .= ' | '; | |
$postinfo_meta .= '<span class="published">' . esc_html( get_the_time( wp_unslash( $date_format ) ) ) . '</span>'; | |
} | |
if ( in_array( 'categories', $postinfo ) ){ | |
if ( in_array( 'author', $postinfo ) || in_array( 'date', $postinfo ) ) $postinfo_meta .= ' | '; | |
$postinfo_meta .= get_the_tag_list( '', ', ' ); | |
$postinfo_meta .= ' | '; | |
$postinfo_meta .= get_the_category_list(', '); | |
} | |
if ( in_array( 'comments', $postinfo ) ){ | |
if ( in_array( 'author', $postinfo ) || in_array( 'date', $postinfo ) || in_array( 'categories', $postinfo ) ) $postinfo_meta .= ' | '; | |
$postinfo_meta .= et_pb_get_comments_popup_link( $comment_zero, $comment_one, $comment_more ); | |
} | |
return $postinfo_meta; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Danilfilatov
Hi, does the above code works after the last DIVI updates? I have the version "3.27.4" and I can not see the code in Blog.php that Blog-1 and Blog-2 dictates to replace it with the tags code.
I made an override in divi-child/module/Blog.php that works but as said I can not find the code that need to be replaced.