term_id ] = $category->name; } return $output; } endif; /** * Colormag_Elementor required setups. * * Particularly used for registering post thumbnail size and others. * * Hooked in after_setup_theme. * * @since ColorMag 2.2.3 */ function colormag_elementor_setup() { // Cropping the images to different sizes to be used in the theme for Elementor. // For the block widgets. add_image_size( 'colormag-elementor-block-extra-large-thumbnail', 1155, 480, true ); // For the grid widgets. add_image_size( 'colormag-elementor-grid-large-thumbnail', 600, 417, true ); add_image_size( 'colormag-elementor-grid-small-thumbnail', 285, 450, true ); add_image_size( 'colormag-elementor-grid-medium-large-thumbnail', 575, 198, true ); } add_action( 'after_setup_theme', 'colormag_elementor_setup' ); if ( ! function_exists( 'colormag_elementor_widgets_meta' ) ) : /** * Display the posts meta for use within Elementor widgets * * @since ColorMag 1.2.3 */ function colormag_elementor_widgets_meta() { ?>
%2$s'; // Displays the different published and updated date if the post is updated. if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); ?> ' . $time_string . ''; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?> ' . esc_html( get_the_author() ) . ''; ?>
'; foreach ( $categories as $category ) { $color_code = colormag_category_color( get_cat_id( $category->cat_name ) ); if ( ! empty( $color_code ) ) { $output .= '' . $category->cat_name . '' . $separator; } else { $output .= '' . $category->cat_name . '' . $separator; } } $output .= ''; if ( 0 == $display ) { $output = trim( $output, $separator ); } if ( 1 == $display ) { echo trim( $output, $separator ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped } } if ( 0 == $display ) { return $output; } } endif;