template include – Use TEMPLATEPATH for custom url

Question

I have a code in below and as you can see I have a condition to read custom template for desktop and mobile. Now I want to use a custom url instead of a file.For example I want to include a page site.com/test instead of index.php

<?php
// Use anywhere
if ( muneeb_wp_is_mobile() ){
 include(TEMPLATEPATH . '/index-mobile.php');
}
else{
include(TEMPLATEPATH . '/index-desktop.php');
} ?>

Can I use this?

include(TEMPLATEPATH . '/site.com/page1');

0
akhbarejadid 7 months 2022-01-01T10:03:26-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse