function blogger_query_vars_filter( $vars ) {
$vars[] = "blogger";
return $vars;
}
add_filter('query_vars', 'blogger_query_vars_filter');
function blogger_template_redirect() {
global $wp_query;
$blogger = $wp_query->query_vars['blogger'];
if ( isset ( $blogger ) ) {
wp_redirect( get_wordpress_url ( $blogger ) , 301 );
exit;
}
}
add_action( 'template_redirect', 'blogger_template_redirect' );
function get_wordpress_url($blogger) {
if ( preg_match('@^(?:https?://)?([^/]+)(.*)@i', $blogger, $url_parts) ) {
$query = new WP_Query (
array ( "meta_key" => "blogger_permalink", "meta_value" => $url_parts[2] ) );
if ($query->have_posts()) {
$query->the_post();
$url = get_permalink();
}
wp_reset_postdata();
}
return $url ? $url : home_url();
}
Winter. Up North. What a special time of year. With over four feet of fresh snow in the past three weeks...and lots more on the way, this is the kind of Christmas that children dream of. Heading into a New Year, the Northland will be covered in a blanket of freshly fallen snow. Children, beside themselves with glee, will take to the hills with their new sleds, snow-boards, and anything else that "goes," making new memories with their playmates and families.
Charles Dickens penned a wonderful thought long ago: "The dreams of childhood...its airy fables, its graceful, beautiful, humane, impossible adornments of the world beyond; so good, to be believed in once, so good to be remembered when outgrown."
Here's wishing you a beautiful Up North
Christmas, and a bright and blessed New Year...no matter where you are. Soli Deo Gloria.