admin管理员组

文章数量:1336643

I want to choose the best way to separate the mobile template and the desktop. Is this the right way? If I put this code in the index.php file:

<?php if ( wp_is_mobile() ) : ?>
    <?php get_template_part('template-parts/mobile'); ?>
<?php else : ?>
    <?php get_template_part('template-parts/desktop'); ?>
<?php endif; ?>

本文标签: how to use a different template (indexphp) in wordpress