Skip to content

Instantly share code, notes, and snippets.

@joehoyle

joehoyle/profile.php

Last active Oct 12, 2015
Embed
What would you like to do?
<?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
You can’t perform that action at this time.