WordPress.org

Ready to get started?Download WordPress

Forums

Rewrite rules help (1 post)

  1. sccr410
    Member
    Posted 1 year ago #

    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 (www.domain.com/page/gallery/gallery-name) instead of query string variables (www.domain.com/page/?gallery=gallery-name)

    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:

    http://www.domain.com/page - This would show the list of all the galleries
    http://www.domain.com/page/gallery/gallery-name - Gallery page with thumbnail images
    http://www.domain.com/page/gallery/gallery-name/2 - Paginated
    http://www.domain.com/page/image/image-name - Single image with various details
    http://www.domain.com/page/favorites - 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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags