WordPress.org

Ready to get started?Download WordPress

Forums

Device Theme Switcher
[resolved] Page Templates (4 posts)

  1. carsen
    Member
    Posted 1 year ago #

    I have several pages on my site that use specific templates. I included mobile versions of all of these templates in my mobile theme (with the same name as in the desktop theme), however when viewed on a mobile device, these pages display in the default page template.

    http://wordpress.org/extend/plugins/device-theme-switcher/

  2. James Mehorter
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Carsen,

    As a test, can you activate your mobile theme as the default theme in 'Appearance > Themes' - do the page templates work?

    I have two production websites running Device Theme Switcher - each site has a computer, tablet, and handheld theme. And each theme has many different page templates (some templates exist in all 3 themes, and some themes have specific templates), and both sites are performing as expected-I just double checked to make sure. I'm hoping you simply have an error in your page template code, causing WordPress to simply default to page.php/index.php. Setting your handheld theme as the active theme should help you debug if that's the case.

    Please post back letting me know what you find. Thanks!

    James

  3. waynmeyer
    Member
    Posted 1 year ago #

    Hi James,

    Fantastic plugin, i plan to use this in my web app im creating, however i have one problem, page templates i create do not show up on the admin page attributes, this means i cannot create a page in the admin dashboard and cannot set a permalink to the page i need for mobile devices.

    i have read all your forums and cant find an answer. When i use the mobile theme as my default theme everything works perfectly, when i use the mobile theme as a switcher theme then i cannot choose page templates because they are not in the parent theme. How can we work around this?

    As i have read in your previous posts that you managed to accomplish this many time before, please assist use so we can all use these amazing features.

    The reason i need different page templates is because my mobile web app will be using completely different loops and single.php content layouts.

    Please give me your best advice, you seem the most active author for this type of plugin, support looks great, hence im willing to use this plugin as i need a support system should i face these kind of issues :)

    kind regards

  4. James Mehorter
    Member
    Plugin Author

    Posted 1 year ago #

    Hi waynmeyer,

    Thanks for your interest in DTS!

    Unfortunately, you can not have different page templates in each theme. This is because, when DTS serves your handheld theme to handheld users, DTS is simply delivering the theme - all the settings / menus / page templates must match the activated theme.

    As an example, when I build a handheld theme I use all the same theme files, but change each of the page templates for the handheld theme. E.g. If you have a 'Contact' page with a page-contact.php template file, in the activated theme I would have the normal loop and such, but in the handheld theme I might add some css to make the buttons bigger or in the loop use an input with type="tel" so users can use their built in phone to call.

    Similarly, if you had a page-home.php file that was used to show a slideshow in the activated theme, in the page-home.php for the handheld theme I might pull smaller image sizes, or less images to save on page load.

    Hope that helps! Let me know if you have any other questions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic