Support » Plugins » Hacks » Rewrite rules help

  • I am writing a basic gallery plugin for WordPress. In the plugin users can mark images as favorites and there is a page where users can see their favorites.

    I want to setup some rewrite rules for the galleries ( instead of query string variables (

    In my plugin settings, users can select a page for the plugin to run off. I store the page ID and want to use this as a base for everything in the galleries.

    Example URLs would be: – This would show the list of all the galleries – Gallery page with thumbnail images – Paginated – Single image with various details – Listing images marked as favorites

    The add_rewrite_rule stuff is somehow completely confusing me and I can’t get anything to work. I am using flush_rewrite_rules(), I know that is a common mistake when trying to setup custom rewrite rules.

  • The topic ‘Rewrite rules help’ is closed to new replies.