Custom post types: change “read more” text

Hmm, and what is the difficulty in here? You already have global $post variable in your function. Just use it. function excerpt_read_more_link($output) { global $post; $text=”Read more”; if ( $post->post_type == ‘MY-CUSTOM-POST-TYPE’ ) // change MY-CUSTOM-POST-TYPE to your real CPT name $text=”Get it now”; return $output . ‘<a class=”more-link” href=”‘. get_permalink($post->ID) . ‘”>’. $text .'</a>’; … Read more

How to remove #more… from the post “More” link?

There you go this will prevent scroll (add to functions.php) function remove_more_link_scroll( $link ) { $link = preg_replace( ‘|#more-[0-9]+|’, ”, $link ); return $link; } add_filter( ‘the_content_more_link’, ‘remove_more_link_scroll’ ); Explained in depth Here.

How can I display “read more” without any other post text?

You can achieve this with many ways. First thing you need to use the_excerpt() instead of the_content() and in your functions.php file you can add this function to return 0 text from post text. function custom_excerpt_length($length) { if (is_home()) { return 0; } } add_filter(‘excerpt_length’, ‘custom_excerpt_length’); This code check if this is homepage you can … Read more

Exclude the content before “the more” on single posts

You probably looking at something like get_extended(). It returns the content in an array with the following key=>value pairs main => The content before the more tag extended => The content after the more tag more_text => The custom read more text So you would want to do the following in your single post page … Read more