Forums

Adding custom template / URL to plugin (2 posts)

  1. Ninestein
    Member
    Posted 2 years ago #

    Hi,

    A few years ago I wrote a gallery for my website that was completely custom. Since then, I've upgraded completely to wordpress. This means that my galleries are sitting in my original tables gathering dust.

    What I'm looking to do is create a plugin that will allow me to share those galleries with people again, using their old structure.

    The approach I want to take is to be able to say all requests with "/gallery/" or similar in, get processed by a function in the plugin. I then need to grab each variable in turn: /gallery/[gallery name]/[image name]

    I've trawled through as must as I can around permalinks and URL handling, and still can't find an answer. I'd rather not have to modify the core of wordpress or the template I'm using. Also would be good as a plugin for others to use once I crack this problem.

    I have a solutions similar to other gallery solutions that involve creating a page and adding a tag, but I'd prefer to make it more flexible and expandable than that.

    Thanks

  2. Ninestein
    Member
    Posted 2 years ago #

    So been thinking about it a little more, and maybe the idea of setting up a page is the best approach.

    Thoughts are:

    Create a page /gallery/ and put the tag on it.
    Add new rule to the .htaccess file to translate the URLs I said upstairs into: /gallery/?param1=&param2=

    Will see if it works. If anyone has another solution, let me know.

Topic Closed

This topic has been closed to new replies.

About this Topic