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 badges1 Answer
Reset to default 2You 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
版权声明:本文标题:custom field - Read more to open external link 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311460a1934744.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论