Advertisement
Guest User

Untitled

a guest
Nov 15th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. Download the plugin from github, https://github.com/Giuseppe-Mazzapica/CleverRules, after you have unzipped the file, you can rename the folder `CleverRules-master` to `CleverRules`. After that, put in plugins folder and activate.
  2.  
  3. To make use of the plugin, you have to write a configuration plugins, because the routing rules cannot be wrote on theme `function.php`.
  4.  
  5. Your plugin will be something like:
  6.  
  7. <?php
  8. /**
  9. * Plugin Name: My Rules
  10. * Author: Me
  11. */
  12.  
  13. add_action('plugins_loaded', 'register_my_rules');
  14.  
  15. function register_my_rules() {
  16.  
  17. if ( ! function_exists('register_clever_rule') ) return;
  18.  
  19. // RULES
  20.  
  21. register_clever_rule(/items/%s/%d')
  22. ->query( 'pagename=items&string=[0]&number=[1]' )
  23. ->vars( array('string','number') ); // make wordpress recognize this additional query variables
  24.  
  25. }
  26.  
  27. Save this plugins in plugins folder and activate it too. See plugin doc page http://rules.zoomlab.it/documentation/ for more info on plugin use.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement