Instantly share code, notes, and snippets.

View redirect category to post
function strytllr_redirect_from_story_to_first_slide(){
global $wp_query;
if( is_archive() && $wp_query->query('showposts=1&order=ASC') ){
the_post();
// Get permalink
$post_url = get_permalink();
// Redirect to post page
wp_redirect( $post_url );
}
}