How can I limit the length of the previous/next posts in my WordPress Theme?
Here’s a little coding that should implement this for you: <?php $max_length = 5; // set max character length here $next = get_next_post()->ID; $prev = get_previous_post()->ID; if( $prev ) { $title = get_the_title( $prev ); $link = get_the_permalink( $prev ); $post_name = mb_strlen( $title ) > $max_length ? mb_substr( $title, 0, $max_length ) . ‘ … Read more