function rr_404_my_event() {
if( is_singular() ) {
global $post, $page;
$num_pages = substr_count( $post->post_content, '<!--nextpage-->' ) + 1;
if( $page > $num_pages ){
global $wp_query;
$wp_query->set_404();
status_header(404);
}
}}
add_action( 'wp', 'rr_404_my_event' );
Комментариев нет:
Отправить комментарий