You mean you just want the page to have the same theme as your WP site? Or you want it to actually show data (not just the visual aspect) from your WP install?
If you just want a page that _looks_ like your theme, there are better methods to use than to access the theme files directly, as they will not mean much without the WP code on the back-end to process things.
One method would be to create a blank page, view it in your browser, and save the page source. You will then have the proper HTML to display the page, without the WP code (since it will be only the final code sent to the browser).
If you _do_ want all the WP data to be shown, and simply need a way to pass a new parameter to a WP page, you can do this.
One example can by found in my sitemap generator plugin for WordPress. It basically ‘tells’ wordpress to look for a new page parameter (in the plugins case – this is the page number for the sitemap output).
Example code from my script:
/*
* Create rewrite rules for sitemap pages
*/
function ddsg_permalinks($rules) {
global $wp_rewrite;
$ddsg_sm_name = trim(get_option('ddsg_sm_name'));
if ($wp_rewrite->use_verbose_rules || !isset($wp_rewrite->use_verbose_rules)) {
$match_form = '$1';
} else {
$match_form = '$matches[1]';
}
if ($ddsg_sm_name != '') {
$newrules[$ddsg_sm_name . '/([0-9]{1,})/?$'] = 'index.php?&pagename=' . $ddsg_sm_name . '&pg=' . $match_form;
$newrules = array_merge($newrules,$rules);
return $newrules;
} else {
return $rules;
}
}
/*
* Initialize query var for sitemap permalinks
*/
function ddsg_query_vars ( $vars ) {
$vars[] = "pg";
return $vars;
}
add_filter('query_vars', 'ddsg_query_vars');
add_filter('rewrite_rules_array', 'ddsg_permalinks');
Where ‘&pg=’ is the parameter the code sees, but due to the rewrite rules the function above passes, it just looks for a numerical value passed after the URL of the sitemap page: /sitemap/3/ etc..
Then you can use this code to grab the value of the parameter:
$wp_query->query_vars['pg']
Btw, this line in the script simply grabs the page slug for the sitemap page, you could just replace this with the slug of whatever page you are getting this extra query var from:
$ddsg_sm_name = trim(get_option(‘ddsg_sm_name’));
Hope that helps 🙂