Capturing custom plugin slug from URL
-
Hi WordPress community,
Long time user, first time plugin writer.
I’m developing a custom exhibition/events plugin for our local Rotorua Museum website that I am converting to WordPress.
I’ve got a custom database table that is storing all the information, and I’ve included a custom tag/slug/friendly url field for each entry.I’m now at the point of showing the information on separate pages with shortcodes to display the different exhibitions (current vs upcoming vs events). But now I’m stumped as to how I capture the unique slug from the URL for the exhibition/event and show the correct entry from the database for it on one page?
Do I:
a) Capture the URL/slug on the 404 error (index.php) page and redirect? – started…
b) Write a custom mod_rewrite in my .htaccess file that points to the one ‘exhibition detail’ page?
c) Try to use a shortcode some how?
d) Create a generic non WordPress ‘dynamic’ old school php page?
e) Give up and throw my toys out?
f) None of the above?Here is the current site in development.
https://72.29.81.173/~museum/index.php/exhibitions-events/now-showing/Any help, links, guidance, support would be gratefully appreciated.
Cheers
Adrian Hodge
- The topic ‘Capturing custom plugin slug from URL’ is closed to new replies.