Custom field – add text, icon, HTML, etc. before and after the value

Content Views Pro helps you to show name, value of custom field easily.
To add custom icon, text, etc. before and after the field’s value, you can use one of 2 following solutions:

Add simple icon, text

Please add this code to Custom CSS field in Content Views >> Settings page:

.pt-cv-custom-fields[class*="FIELD_NAME"] {
    display: block !important;
}
.pt-cv-custom-fields[class*="FIELD_NAME"]:before {
    display: block;
    content: 'Your text here';
}
.pt-cv-custom-fields[class*="FIELD_NAME"]:after {
    display: block;
    content: 'Your text here';
}

Add complex HTML

Please add this code to file functions.php in the directory of your active theme:

// Content Views Pro - Prepend prefix for custom field
add_filter( 'pt_cv_ctf_value', 'cvp_theme_ctf_value_prepend', 100, 3 );
function cvp_theme_ctf_value_prepend( $value, $key, $post ) {

	if ( $key === 'FIELD_NAME_1' ) {
		$value = 'YOUR CUSTOM HTML' . $value . 'YOUR CUSTOM HTML';
	}

	if ( $key === 'FIELD_NAME_2' ) {
		$value = 'YOUR CUSTOM HTML' . $value . 'YOUR CUSTOM HTML';
	}

	// and so on
	
	return $value;
}

For both cases, please replace FIELD_NAME_1, FIELD_NAME_2 with name of your custom fields.

Best regards,