WordPress Create Frontend pages with plugin

So I need some help with a plugin I’m currently working on. Basically I built a plugin for WP with its own unique tables, as opposed to using a custom post type. The reason is because I needed a few relationships between the databases. So now I’ve got all of the backend information connected and working, and now I’m trying to display it on the front-end of WordPress. I’m not sure how to even phrase what I’m trying to do, but basically I want to be able to display the database information when a user accesses a specific url without having to create a WP page and add a shortcode or adding a template file. How would I go about doing something like that?

Related posts

Leave a Reply

1 comment

  1. You can use wordpress’ wpdb functions to query any database that you have created. This can be on any page/template within wordpress.
    http://codex.wordpress.org/Class_Reference/wpdb

    function displayStuff(){
      global $wpdb;
      $query = "SELECT * FROM yourdatabase";
      $results = $wpdb->query($query);
    }
    

    If using outside of wordpress, just use standard php mysql_connect & mysql_query, or include wordpress in your page:

    require($_SERVER['DOCUMENT_ROOT'] . '/wp-blog-header.php');