How to add a Read More button to your listings excerpt_more

You can add a read more button to your listings or any post using the following function. Or some themes remove this hook so check your theme options for the Read More setting.

This function will return Listing Details on your listings or Read More on your posts.

Add this to your theme functions file.

function my_excerpt_more($more) {
	global $post;
	$post_type = get_post_type($post);
	
	if ( $post_type == 'rental' || $post_type == 'property' || $post_type == 'land' ) {
		return '<div class="more-link"><a href="'. get_permalink($post->ID) . '">Listing Details &rarr;</a></div>';
	} else {
		return '<div class="more-link"><a href="'. get_permalink($post->ID) . '">Read More &rarr;</a></div>';
	}
}
add_filter('excerpt_more', 'my_excerpt_more');