Permalink
Browse files

Show pages, not just posts, on category pages.

  • Loading branch information...
1 parent b0fc615 commit a6e0519f220de3e54aabac7fec6508d3453492fb @scottgonzalez scottgonzalez committed Mar 25, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 mu-plugins/jquery-tags-on-pages.php
@@ -7,9 +7,14 @@
* Version: 1.0
*/
-add_action( 'init', 'jquery_taxonomies_on_pages' );
-function jquery_taxonomies_on_pages() {
+add_action( 'init', function() {
register_taxonomy_for_object_type( 'post_tag', 'page' );
register_taxonomy_for_object_type( 'category', 'page' );
-}
+});
+add_filter( 'request', function( $query ) {
+ if ( !empty( $query[ 'tag' ] ) || !empty( $query[ 'category_name' ] ) ) {
+ $query[ 'post_type' ] = array( 'post', 'page' );
+ }
+ return $query;
+});

0 comments on commit a6e0519

Please sign in to comment.