<?php
/****************************************
* Main.php
*
* The main template file, that loads the header, footer and sidebar
* apart from loading the appropriate rtMedia template
*****************************************/
// by default it is not an ajax request
global $rt_ajax_request;
$rt_ajax_request = false;
// check if it is an ajax request
if (
! empty( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) &&
strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) == 'xmlhttprequest'
){
$rt_ajax_request = true;
}
//if it's not an ajax request, load headers
if ( ! $rt_ajax_request ) {
// if this is a BuddyPress page, set template type to
// buddypress to load appropriate headers
if ( class_exists( 'BuddyPress' ) && ! bp_is_blog_page() ) {
$template_type = 'buddypress';
} else {
$template_type = '';
}
get_header( $template_type ); }
// the markup for the template starts
?>
That is the only part of the old template code from rtMedia I have left in because without that the template won’t work. (And the PHP where the gallery etc is called is still in the template file but on the right spot.)