• I have created some custom page templates which work for my desktop site but the mobile site (wptouch) isn’t displaying them. Instead it shows the content on the page rather than using the custom template php content.

    Does the free version recognise custom page templates?

Viewing 4 replies - 1 through 4 (of 4 total)
  • no, wpt uses its own theme, but assuming u can open a shell, link your c.p.t.s into it & they will be recognized:

    ln -s ~/www/wp-content/themes/yourtheme/cpt.php ~/www/wp-content/plugins/wptouch/themes/bauhaus/default

    Thread Starter tippers

    (@tippers)

    Perfect, thank you. I think I’d previously copied the php files into the wptouch-data directory so thank you for pointing me to the right place and using symlinks is much better.

    One further question, in the page template php file, I have a link to a custom css file in my child theme directory. When I view the page from a mobile, the css file isn’t loaded and styling isn’t applied. Any ideas please?

    Thread Starter tippers

    (@tippers)

    I had to add the following to my child theme functions.php

    function wpse_enqueue_page_template_styles() {
        if ( is_page_template( 'mytemplate.php' )) {
            wp_enqueue_style( 'page-template', get_stylesheet_directory_uri() . '/mystyle.css' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'wpse_enqueue_page_template_styles' );

    So I then added the same code to the functions.php in /wp-content/plugins/wptouch/themes/bauhaus/default. Initially it couldn’t find mystyle.css (404) so I added a symlink for mystyle.css but it then complained that it didn’t have permission (403) – which it did. The workaround was remove the symlink and to copy the css file in to the bauhaus/default directory.

    yes: link the css into the wpt them directory as well…and remember that depending on the extent of any wpt update (if the them dir is replaced rather than writtten into) the links will have to be restored…i have a crontab script that runs daily

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom page templates’ is closed to new replies.