admin管理员组

文章数量:1122846

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?

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 asked Aug 30, 2013 at 14:10 levatlevat 1691 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

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.

本文标签: custom fieldRead more to open external link