Skip to content

Instantly share code, notes, and snippets.

@matgargano
Created September 4, 2013 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matgargano/6431310 to your computer and use it in GitHub Desktop.
Save matgargano/6431310 to your computer and use it in GitHub Desktop.
<?php
add_filter('query_vars', function($vars){
$vars[] = 'featured';
return $vars;
});
add_action('init', function(){
add_rewrite_rule('sponsors/test/?$', 'index.php?post_type=sponsors&featured=true', 'top');
});
add_action('wp_head', function(){
echo "featured is ... ";
echo get_query_var('featured') ? get_query_var('featured') : ' NOT SET!';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment