Created
June 26, 2018 15:00
-
-
Save campusboy87/48dad25c0e1d67aac5d4c45b38a31ce7 to your computer and use it in GitHub Desktop.
Имитирует функционал "Отображать на статической странице список записей".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'request', function ( $query_vars ) { | |
if ( isset( $query_vars['pagename'] ) && $query_vars['pagename'] === 'all-articles' ) { | |
add_filter( "pre_option_page_for_posts", function () { | |
return 484; // ID нужной страницы | |
} ); | |
} | |
return $query_vars; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment