开发者

Wordpress: Remove link #id for read more

开发者 https://www.devze.com 2023-03-12 01:35 出处:网络
When we do looping in wordpress, and the content has <!--more--> wordpress will cut the content in frontend view开发者_开发知识库and give us link like \"read more\"

When we do looping in wordpress, and the content has <!--more--> wordpress will cut the content in frontend view 开发者_开发知识库and give us link like "read more"

An example link of readmore: http://domain.com/foo/#204.

How do I remove the part of #204?


Just modify your code


Before
$output .= ' <a href="'. get_permalink() . "#more-$id\" class=\"more-link\">$more_link_text</a>";

After

$output .= ' <a href="'. get_permalink() ."\" class=\"more-link\">$more_link_text</a>";

Or this plugin

http://wordpress.org/extend/plugins/more-link-modifier/

Source: http://wordpress.org/support/topic/remove-anchor-link-from-read-more-link

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号