Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to have custom field in post editing area where can be putted the external link.

If the link is entered to this field then read more button on homepage would open external link, but if that field is not filled then to use default read more functionality and open a post.

Is there some plugin for this or some hack?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You just need to add target="_blank" to the anchor tag.

function remove_more_link_scroll( $link ) {
$link = str_replace('>',' target="_blank">', $link);
return $link;
}
add_filter( 'the_content_more_link', 'remove_more_link_scroll' );

I feel compelled to state that I consider forcing new tabs/windows to be very unfriendly behavior, and if you search the web you will see that I am not alone in that opinion.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.