This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| function alter_the_query( $request ) { | |
| $dummy_query = new WP_Query(); // the query isn't run if we don't pass any query vars | |
| $dummy_query->parse_query( $request ); | |
| // this is the actual manipulation; do whatever you need here | |
| if ( $dummy_query->is_home() ) | |
| $request['category_name'] = 'news'; | |
| return $request; | |
| } |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |