Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. RewriteCond %{REQUEST_URI} ^/$
  2. RewriteCond %{QUERY_STRING} ^s=(.+)$
  3. RewriteRule .* /searchmyblog/%1/? [R,L]
  4.  
  5. if ( ! function_exists( 't5_search_base' ) )
  6. {
  7. register_activation_hook( __FILE__ , 't5_flush_rewrite_on_init' );
  8. register_deactivation_hook( __FILE__ , 't5_flush_rewrite_on_init' );
  9. add_action( 'init', 't5_search_base' );
  10.  
  11. function t5_search_base()
  12. {
  13. $GLOBALS['wp_rewrite']->search_base = 'searchmyblog';
  14. }
  15.  
  16. function t5_flush_rewrite_on_init()
  17. {
  18. add_action( 'init', 'flush_rewrite_rules', 11 );
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement