Support » Plugins » integrated existing web app into wp (not the other way around)

  • Resolved psychomachine



    I’ve been working on a web app (PHP, MYSQL). now i am trying to integrate it with wp. the idea is simple: wp in root directory, application as a subdirectory of the root directory. –> WP –> webapp served rom root/app subdirectory

    i’d like the webapp’s output to be placed in the main content of the page (where normally you’d see posts), but i’d still want WP to be responsible for header, sidebar and footer, as it is in regular wp posts.

    could somebody give me a hint or two how to achieve this? would this be the stuff for a plugin? or just a matter of redirects? i don’t know where to start. my web app is fully functioning, but i don’t know how to start building the bridge to wp.

    all best,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Use a Page Template.

    Basically you’re going to make a new PHP file in your WordPress theme. It’s going to start like this:

    Template Name: Whatever you want

    Then you’re going to make a new Page in WordPress (using Write->Write Page). This page will use this Template (look on the right hand side of the page and choose your template). Set the slug for this page to “app”, thus giving you the URL. Your app won’t actually be inside the “app” subdirectory anymore, you’ll have to move it somewhere.

    Finally, your Page Template will be custom coded to call your application. But before it does that, it’ll call get_header(), get_sidebar(), and finally get_footer() to display those things. Other than that, it can run any PHP code you like.

    That’s not the only way to do it, but it is perhaps the simplest and most easily customizable to fit into the site properly.

    Other possible ways:
    – Write a plugin that catches the “app” name and redirects it.
    – Make your app include the wp-blog-header.php file and then call the header/sidebar/footer functions from the app itself.

    dear otto,

    many thanks for your reply — that’s exactly what i needed.

    all best,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘integrated existing web app into wp (not the other way around)’ is closed to new replies.