con estas funciones desde un plugin eh logrado cargar una seccion nueva cuando se pasa por get dm_id , pero me sigue cargando el home
Código PHP:
###############################################################################################################
### 132613 Add dm_id to query vars
function DownloadsManager_DmVars($public_query_vars) {
$public_query_vars[] = "dm_id";
return $public_query_vars;
}
## Function: Short Code For Inserting Stats Into Page
add_shortcode('dm_id', 'stats_page_shortcode');
function stats_page_shortcode($atts) {
return dm_id();
}
$temp_stats = apply_filters('wp_stats_page_most', $temp_stats);
## 13263 no se para que sirve
function is_download ($page = '') {
global $wp_query;
if ( !$wp_query->is_download )
return false;
if ( empty($page) )
return true;
$page_obj = $wp_query->get_queried_object();
$page = (array) $page;
if ( in_array( $page_obj->ID, $page ) )
return true;
elseif ( in_array( $page_obj->post_title, $page ) )
return true;
else if ( in_array( $page_obj->post_name, $page ) )
return true;
return false;
}
### 1326 carga el archivo downloads.php a template
function get_downloads_template() {
global $wp_query;
$id = (int) $wp_query->post->ID;
$template = get_post_meta($id, '_wp_page_template', true);
if ( 'default' == $template )
$template = '';
if ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") )
$template = TEMPLATEPATH . "/$template";
elseif ( file_exists(TEMPLATEPATH . "/downloads.php") )
$template = TEMPLATEPATH . "/downloads.php";
else
$template = '';
return apply_filters('page_template', $template);
}
### 132613 llama al template cuando se pasa dm_id
function DownloadsManager_Downloads() {
$id = intval(get_query_var('dm_id'));
if($id > 0) {
$template = get_downloads_template();
include($template);
return;
}
}