Support » Plugins » Hacks » Add page to public side of WordPress

  • Hi guys,

    I am developing a custom WordPress plugin for a site. The basic goal of the plugin is a gallery of sorts with user uploads. There’s quite a bit more to it than that obviously but that should paint the picture good enough.

    I already have the administrator side complete. I am now looking at the best way to do the front end. My plugin will have a ‘homepage’ and hundreds of different gallery pages with hundreds of thousands of files. Example URLs of these pages:


    What is the best way to get WP to not 404 these URLs and instead pass them off to my plugin? Additionally, what would be the best way to compile these pages output, keeping in mind I still want to utilize the theme’s header, footer, and general layout of course.


Viewing 1 replies (of 1 total)
  • Moderator bcworkz


    To utilize such urls, use the Rewrite API. My approach would be user galleries would be essentially posts, so you can use the existing tag and category tools. All the images would be attachments, thus everything is in the database. Then you can use the url elements you get via the rewrite API to construct queries to return the appropriate content.

    Be sure you sanitize all the url elements before you use them in queries.

Viewing 1 replies (of 1 total)
  • The topic ‘Add page to public side of WordPress’ is closed to new replies.