是否有可能更改wordpress中的分页:https://schoblatt.de/page/2至:https://schoblatt.de/page/2#content
我找到:_after_page_number并测试此:
<?php
add_action( 'init', 'my_custom_page_word' );
function my_custom_page_word() {
global $wp_rewrite; // Get the global wordpress rewrite-rules/settings
// Change the pagination property which sets the wordpress pagination slug.
$wp_rewrite->pagination_after_page_number = "#Content"; //where new-slug is the slug you want to use ;)
} ?>
但它不工作,我没有经验的php。
1条答案
按热度按时间eyh26e7m1#
如果您使用paginate_links函数创建分页,它具有
add_fragment
参数,该参数是"附加到每个链接的字符串"。示例: