Created
January 19, 2015 19:30
-
-
Save yllus/ebb21174e273efa4083a to your computer and use it in GitHub Desktop.
Display a custom page template/view if a "rssa" GET parameter is placed in a post's URL
This file contains hidden or 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
| // If the query parameter is passed, use a different article template than the usual | |
| // (this one has no header/footer). | |
| function rssa_content_mobile_view() { | |
| if ( isset( $_GET['rssa'] ) && is_singular() ) { | |
| require '/some-path/article/view.article.mobile-view.php'; | |
| exit; | |
| } | |
| } | |
| add_action( 'template_redirect', 'rssa_content_mobile_view' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment