Last active
October 16, 2019 15:28
-
-
Save patilvikasj/42f3d9d5ac5ebe1dd065e98161fb10cc to your computer and use it in GitHub Desktop.
This is custom snippet to overwrite blog template for category archive page.
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
| <?php // Do not include this line in your functions.php file. | |
| add_filter( 'astra_blog_template_name', function( $name ) { | |
| // Replace `block` with your category slug. | |
| if( is_category( 'block' ) ) { | |
| return 'block'; | |
| } | |
| // For category with slug "book". You need to add template file `blog-layout-book.php` file to get this work. | |
| if( is_category( 'book' ) ) { | |
| return 'book'; | |
| } | |
| return $name; | |
| } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment