Last active
October 12, 2015 14:27
-
-
Save joehoyle/4040311 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 | |
hm_rewrite_rule( array( | |
'regex' => '^users/([^/]+)/?', | |
'query' => 'author_name=$matches[1]&', | |
'template' => 'user-archive.php', | |
'body_class_callback' => function( $classes ) { | |
$classes[] = 'user-archive'; | |
$classes[] = 'user-' . get_query_var( 'author_name' ); | |
return $classes; | |
}, | |
'title_callback' => function( $title, $seperator ) { | |
return get_query_var( 'author_name' ) . ' ' . $seperator . ' ' . $title; | |
} | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment