By default, you can customize the “Read More” text for all posts in View easily, using the built-in setting.
If you want to customize this text for each post, you can use simple steps below:
- add new custom field:
cvp_readmore_text
for posts which you want to customize the “Read More” text (click to read about how to add new custom field) - add this code to file functions.php of your active theme:
// Content Views Pro - Customize "Read More" text for each post add_filter( 'pt_cv_dargs_others', 'cvp_theme_change_readmore_text_per_post', 999, 2 ); function cvp_theme_change_readmore_text_per_post( $dargs, $post_idx ) { global $post; $meta = get_post_meta( $post->ID ); if ( !empty( $meta[ 'cvp_readmore_text' ][ 0 ] ) ) { $dargs[ 'field-settings' ][ 'content' ][ 'readmore-text' ] = $meta[ 'cvp_readmore_text' ][ 0 ]; } return $dargs; }
Best regards,