how to use a different template (index.php) in wordpress

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

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; ?>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742417176a4439964.html

相关推荐

  • how to use a different template (index.php) in wordpress

    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

    8小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信