I'm porting a site from Drupal 7 to WordPress, and am kind of a WP newbie. In Drupal, I was very used to using the menu system to set up various paths that, when accessed, would run some code (that I wrote) and display the results. Dead simple stuff, but I can't figure out how to do the same sort of thing in WP.

All I want to do is to set up /some-random-path as a URL that, when accessed, will run some function that I've written, generate a bunch of HTML, and show the result. There has to be a way to do this in WP, but I haven't been able to find it. Can anyone point me to the right place? Thanks!

  • It sounds like you're looking for the Rewrite API, which would allow you to define some-random-path and determine what function runs when that URL is accessed.
    – Pat J
    Mar 8 '21 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.