What I have did so far is added following code to the class-front.php at top :
function themeslug_query_vars( $qvars ) {
$qvars[] = 'wpsl_id';
return $qvars;
}
add_filter( 'query_vars', 'themeslug_query_vars' , 10, 1 );
add_filter('template_include', 'my_template', 1, 1);
function my_template($template){
global $wp_query;
global $wp;
//$paged = ( get_query_var( 'wpsl_id' ) ) ? get_query_var( 'wpsl_id' ) : 1;
if ($wp->query_vars["wpsl_id"] == '3'){
$template = WPSL_URL.'page-wpsl_id.php';
}
else{
$template = WPSL_URL.'frontend/templates/store-listings-aroma.php';
}
return $template;
}
But it is giving me the error. Is there any other way to do it ? Or how can I improve this ?