| @@ -1049,9 +1049,9 @@ | ||
| 1049 | 1049 | |
| 1050 | 1050 | $l = 0; |
| 1051 | 1051 | } |
| 1052 | 1052 | $pID = get_the_ID(); |
| 1053 | - $external_link = get_post_meta($pID, 'tpg_read_more', true); | |
| 1053 | + $external_link = get_post_meta( $pID, 'tpg_read_more', true ); | |
| 1054 | 1054 | $arg['postCount'] = $gridPostCount ++; |
| 1055 | 1055 | $arg['pID'] = $pID; |
| 1056 | 1056 | $arg['title'] = Fns::get_the_title( $pID, $arg ); |
| 1057 | 1057 | $arg['pLink'] = $external_link['url'] ?? get_permalink(); |
| @@ -1063,11 +1063,26 @@ | ||
| 1063 | 1063 | ); |
| 1064 | 1064 | $comments_number = get_comments_number( $pID ); |
| 1065 | 1065 | $comments_text = sprintf( '(%s)', number_format_i18n( $comments_number ) ); |
| 1066 | 1066 | |
| 1067 | - $arg['date'] = get_the_date(); | |
| 1068 | - $arg['excerpt'] = Fns::get_the_excerpt( $pID, $arg ); | |
| 1069 | - $arg['categories'] = Fns::rt_get_the_term_list( $pID, 'category', null, '<span class="rt-separator">,</span>' ); | |
| 1067 | + $arg['date'] = get_the_date(); | |
| 1068 | + $arg['excerpt'] = Fns::get_the_excerpt( $pID, $arg ); | |
| 1069 | + $default_taxonomy = 'category'; | |
| 1070 | + $_all_post_types = array_keys( Fns::get_post_types() ); | |
| 1071 | + | |
| 1072 | + if ( $postType && ! in_array( $postType, [ 'post', 'page' ] ) && in_array( $postType, $_all_post_types ) ) { | |
| 1073 | + $taxonomies = get_object_taxonomies( $postType ); | |
| 1074 | + | |
| 1075 | + if ( in_array( '_taxonomy_filter', $filters ) && $taxFilter ) { | |
| 1076 | + $default_taxonomy = $taxFilter; | |
| 1077 | + } else if ( ! empty( $scMeta['tpg_taxonomy'] ) ) { | |
| 1078 | + $default_taxonomy = $scMeta['tpg_taxonomy'][0]; | |
| 1079 | + } else if ( ! empty( $taxonomies ) ) { | |
| 1080 | + $default_taxonomy = $taxonomies[0]; | |
| 1081 | + } | |
| 1082 | + } | |
| 1083 | + | |
| 1084 | + $arg['categories'] = Fns::rt_get_the_term_list( $pID, $default_taxonomy, null, '<span class="rt-separator">,</span>' ); | |
| 1070 | 1085 | $arg['tags'] = get_the_term_list( $pID, 'post_tag', null, '<span class="rt-separator">,</span>' ); |
| 1071 | 1086 | $arg['post_count'] = get_post_meta( $pID, Fns::get_post_view_count_meta_key(), true ); |
| 1072 | 1087 | $arg['responsiveCol'] = [ $dCol, $tCol, $mCol ]; |
| 1073 | 1088 | |